#include "chrome/browser/ui/views/side_panel/side_panel.h"
#include <memory>
#include "base/functional/bind.h"
#include "base/i18n/number_formatting.h"
#include "base/i18n/rtl.h"
#include "base/memory/raw_ptr.h"
#include "base/time/time.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_element_identifiers.h"
#include "chrome/browser/ui/browser_window/public/browser_window_features.h"
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/top_container_background.h"
#include "chrome/browser/ui/views/side_panel/side_panel_coordinator.h"
#include "chrome/browser/ui/views/side_panel/side_panel_enums.h"
#include "chrome/browser/ui/views/side_panel/side_panel_resize_area.h"
#include "chrome/browser/ui/views/side_panel/side_panel_util.h"
#include "chrome/common/pref_names.h"
#include "chrome/grit/generated_resources.h"
#include "components/lens/lens_features.h"
#include "components/prefs/pref_service.h"
#include "third_party/skia/include/core/SkPath.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/ui_base_features.h"
#include "ui/color/color_provider.h"
#include "ui/compositor/layer.h"
#include "ui/gfx/color_palette.h"
#include "ui/gfx/geometry/dip_util.h"
#include "ui/gfx/geometry/insets_conversions.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/rect_f.h"
#include "ui/gfx/geometry/rounded_corners_f.h"
#include "ui/gfx/geometry/skia_conversions.h"
#include "ui/gfx/scoped_canvas.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/border.h"
#include "ui/views/controls/separator.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/layout/flex_layout.h"
#include "ui/views/layout/layout_provider.h"
#include "ui/views/view_class_properties.h"
#include "ui/views/view_observer.h"
namespace {
int GetBorderThickness() { … }
constexpr int kOverlapFromToolbar = …;
gfx::Insets GetBorderInsets() { … }
constexpr int kAnimationDurationMs = …;
class SidePanelBorder : public views::Border { … };
class BorderView : public views::View { … };
BEGIN_METADATA(…)
}
class SidePanel::VisibleBoundsViewClipper : public views::ViewObserver { … };
SidePanel::SidePanel(BrowserView* browser_view,
HorizontalAlignment horizontal_alignment)
: … { … }
SidePanel::~SidePanel() = default;
void SidePanel::SetPanelWidth(int width) { … }
void SidePanel::SetBackgroundRadii(const gfx::RoundedCornersF& radii) { … }
void SidePanel::SetHorizontalAlignment(HorizontalAlignment alignment) { … }
SidePanel::HorizontalAlignment SidePanel::GetHorizontalAlignment() { … }
bool SidePanel::IsRightAligned() { … }
gfx::Size SidePanel::GetMinimumSize() const { … }
bool SidePanel::IsClosing() { … }
void SidePanel::AddHeaderView(std::unique_ptr<views::View> view) { … }
gfx::Size SidePanel::GetContentSizeUpperBound() const { … }
void SidePanel::ChildVisibilityChanged(View* child) { … }
void SidePanel::OnBoundsChanged(const gfx::Rect& previous_bounds) { … }
double SidePanel::GetAnimationValue() const { … }
void SidePanel::OnChildViewAdded(View* observed_view, View* child) { … }
void SidePanel::OnChildViewRemoved(View* observed_view, View* child) { … }
void SidePanel::OnViewPropertyChanged(View* observed_view,
const void* key,
int64_t old_value) { … }
void SidePanel::AnimationProgressed(const gfx::Animation* animation) { … }
void SidePanel::AnimationEnded(const gfx::Animation* animation) { … }
void SidePanel::UpdateSidePanelWidthPref(const std::string& panel_id,
int width) { … }
void SidePanel::OnResize(int resize_amount, bool done_resizing) { … }
void SidePanel::RecordMetricsIfResized() { … }
void SidePanel::UpdateVisibility() { … }
bool SidePanel::ShouldShowAnimation() const { … }
void SidePanel::AnnounceResize() { … }
BEGIN_METADATA(…)