Commit 8efc55d5 authored by Elly Fong-Jones's avatar Elly Fong-Jones Committed by Commit Bot

views: remove WidgetDelegate::WillProcessWorkAreaChange

This method is only implemented on the base class, which always returns
false. Delete the method, its implementation, a wrapper around it in
DesktopWindowTreeHostWin, and the only call to it in HWNDMessageHandler.

Open question: is WidgetDelegate::HandleWorkAreaChanged() now dead? It
can only be called in HWNDMessageHandler::OnSettingChange() when
GetParent(hwnd()), but under what circumstances is that true?

Bug: None
Change-Id: Ib00d0b67597ded401c624786b54051bdf2373769
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2364212Reviewed-by: default avatarRobert Liao <robliao@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799829}
parent 1144ff05
...@@ -737,10 +737,6 @@ int DesktopWindowTreeHostWin::GetInitialShowState() const { ...@@ -737,10 +737,6 @@ int DesktopWindowTreeHostWin::GetInitialShowState() const {
return CanActivate() ? SW_SHOWNORMAL : SW_SHOWNOACTIVATE; return CanActivate() ? SW_SHOWNORMAL : SW_SHOWNOACTIVATE;
} }
bool DesktopWindowTreeHostWin::WillProcessWorkAreaChange() const {
return GetWidget()->widget_delegate()->WillProcessWorkAreaChange();
}
int DesktopWindowTreeHostWin::GetNonClientComponent( int DesktopWindowTreeHostWin::GetNonClientComponent(
const gfx::Point& point) const { const gfx::Point& point) const {
gfx::Point dip_position = gfx::Point dip_position =
......
...@@ -175,7 +175,6 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin ...@@ -175,7 +175,6 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin
bool WidgetSizeIsClientSize() const override; bool WidgetSizeIsClientSize() const override;
bool IsModal() const override; bool IsModal() const override;
int GetInitialShowState() const override; int GetInitialShowState() const override;
bool WillProcessWorkAreaChange() const override;
int GetNonClientComponent(const gfx::Point& point) const override; int GetNonClientComponent(const gfx::Point& point) const override;
void GetWindowMask(const gfx::Size& size, SkPath* path) override; void GetWindowMask(const gfx::Size& size, SkPath* path) override;
bool GetClientAreaInsets(gfx::Insets* insets, bool GetClientAreaInsets(gfx::Insets* insets,
......
...@@ -215,10 +215,6 @@ View* WidgetDelegate::CreateOverlayView() { ...@@ -215,10 +215,6 @@ View* WidgetDelegate::CreateOverlayView() {
return nullptr; return nullptr;
} }
bool WidgetDelegate::WillProcessWorkAreaChange() const {
return false;
}
bool WidgetDelegate::WidgetHasHitTestMask() const { bool WidgetDelegate::WidgetHasHitTestMask() const {
return false; return false;
} }
......
...@@ -249,12 +249,6 @@ class VIEWS_EXPORT WidgetDelegate { ...@@ -249,12 +249,6 @@ class VIEWS_EXPORT WidgetDelegate {
// targeting). // targeting).
virtual View* CreateOverlayView(); virtual View* CreateOverlayView();
// Returns true if the window can be notified with the work area change.
// Otherwise, the work area change for the top window will be processed by
// the default window manager. In some cases, like panel, we would like to
// manage the positions by ourselves.
virtual bool WillProcessWorkAreaChange() const;
// Returns true if window has a hit-test mask. // Returns true if window has a hit-test mask.
virtual bool WidgetHasHitTestMask() const; virtual bool WidgetHasHitTestMask() const;
......
...@@ -2532,8 +2532,7 @@ LRESULT HWNDMessageHandler::OnSetText(const wchar_t* text) { ...@@ -2532,8 +2532,7 @@ LRESULT HWNDMessageHandler::OnSetText(const wchar_t* text) {
} }
void HWNDMessageHandler::OnSettingChange(UINT flags, const wchar_t* section) { void HWNDMessageHandler::OnSettingChange(UINT flags, const wchar_t* section) {
if (!GetParent(hwnd()) && (flags == SPI_SETWORKAREA) && if (!GetParent(hwnd()) && (flags == SPI_SETWORKAREA)) {
!delegate_->WillProcessWorkAreaChange()) {
// Fire a dummy SetWindowPos() call, so we'll trip the code in // Fire a dummy SetWindowPos() call, so we'll trip the code in
// OnWindowPosChanging() below that notices work area changes. // OnWindowPosChanging() below that notices work area changes.
::SetWindowPos(hwnd(), nullptr, 0, 0, 0, 0, ::SetWindowPos(hwnd(), nullptr, 0, 0, 0, 0,
......
...@@ -82,8 +82,6 @@ class VIEWS_EXPORT HWNDMessageHandlerDelegate { ...@@ -82,8 +82,6 @@ class VIEWS_EXPORT HWNDMessageHandlerDelegate {
// window. // window.
virtual int GetInitialShowState() const = 0; virtual int GetInitialShowState() const = 0;
virtual bool WillProcessWorkAreaChange() const = 0;
virtual int GetNonClientComponent(const gfx::Point& point) const = 0; virtual int GetNonClientComponent(const gfx::Point& point) const = 0;
virtual void GetWindowMask(const gfx::Size& size, SkPath* mask) = 0; virtual void GetWindowMask(const gfx::Size& size, SkPath* mask) = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment