diff --git a/shell/browser/api/electron_api_view.cc b/shell/browser/api/electron_api_view.cc index ef37cb63c2d..66134739682 100644 --- a/shell/browser/api/electron_api_view.cc +++ b/shell/browser/api/electron_api_view.cc @@ -280,7 +280,7 @@ void View::SetBounds(const gfx::Rect& bounds) { view_->SetBoundsRect(bounds); } -gfx::Rect View::GetBounds() { +gfx::Rect View::GetBounds() const { if (!view_) return {}; return view_->bounds(); diff --git a/shell/browser/api/electron_api_view.h b/shell/browser/api/electron_api_view.h index d63f5abc83b..298a5772a74 100644 --- a/shell/browser/api/electron_api_view.h +++ b/shell/browser/api/electron_api_view.h @@ -21,8 +21,6 @@ class Handle; namespace electron::api { -using ChildPair = std::pair, v8::Global>; - class View : public gin_helper::EventEmitter, private views::ViewObserver { public: @@ -39,7 +37,7 @@ class View : public gin_helper::EventEmitter, void RemoveChildView(gin::Handle child); void SetBounds(const gfx::Rect& bounds); - gfx::Rect GetBounds(); + gfx::Rect GetBounds() const; void SetLayout(v8::Isolate* isolate, v8::Local value); std::vector> GetChildren(); void SetBackgroundColor(std::optional color); @@ -47,12 +45,6 @@ class View : public gin_helper::EventEmitter, void SetVisible(bool visible); bool GetVisible() const; - // views::ViewObserver - void OnViewBoundsChanged(views::View* observed_view) override; - void OnViewIsDeleting(views::View* observed_view) override; - void OnChildViewRemoved(views::View* observed_view, - views::View* child) override; - views::View* view() const { return view_; } std::optional border_radius() const { return border_radius_; } @@ -69,6 +61,14 @@ class View : public gin_helper::EventEmitter, void set_delete_view(bool should) { delete_view_ = should; } private: + using ChildPair = std::pair, v8::Global>; + + // views::ViewObserver + void OnViewBoundsChanged(views::View* observed_view) override; + void OnViewIsDeleting(views::View* observed_view) override; + void OnChildViewRemoved(views::View* observed_view, + views::View* child) override; + void ApplyBorderRadius(); void ReorderChildView(gin::Handle child, size_t index);