summaryrefslogtreecommitdiffstats
path: root/views/widget
diff options
context:
space:
mode:
authorjianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-06 21:19:09 +0000
committerjianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-06 21:19:09 +0000
commit234900cd8aca4d8327005e68f364e261253c4d0b (patch)
treeb5f5b6da02ce220e081f1f662c75bf9930c7162d /views/widget
parentefbf102695191ded451277dc0dd46be3a5e9091b (diff)
downloadchromium_src-234900cd8aca4d8327005e68f364e261253c4d0b.zip
chromium_src-234900cd8aca4d8327005e68f364e261253c4d0b.tar.gz
chromium_src-234900cd8aca4d8327005e68f364e261253c4d0b.tar.bz2
Make panels adjust their positions when display settings or work area has been changed.
BUG=none TEST=Manual test for now. Will add test coverage when I add test for PanelManager. Review URL: http://codereview.chromium.org/7076036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88037 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget')
-rw-r--r--views/widget/native_widget_win.cc3
-rw-r--r--views/widget/widget_delegate.cc4
-rw-r--r--views/widget/widget_delegate.h6
3 files changed, 12 insertions, 1 deletions
diff --git a/views/widget/native_widget_win.cc b/views/widget/native_widget_win.cc
index d7b75c5..cd6fc64 100644
--- a/views/widget/native_widget_win.cc
+++ b/views/widget/native_widget_win.cc
@@ -1285,7 +1285,8 @@ LRESULT NativeWidgetWin::OnSetText(const wchar_t* text) {
}
void NativeWidgetWin::OnSettingChange(UINT flags, const wchar_t* section) {
- if (!GetParent() && (flags == SPI_SETWORKAREA)) {
+ if (!GetParent() && (flags == SPI_SETWORKAREA) &&
+ !GetWidget()->widget_delegate()->WillProcessWorkAreaChange()) {
// Fire a dummy SetWindowPos() call, so we'll trip the code in
// OnWindowPosChanging() below that notices work area changes.
::SetWindowPos(GetNativeView(), 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
diff --git a/views/widget/widget_delegate.cc b/views/widget/widget_delegate.cc
index fa91e7b..e63cbbb 100644
--- a/views/widget/widget_delegate.cc
+++ b/views/widget/widget_delegate.cc
@@ -144,5 +144,9 @@ NonClientFrameView* WidgetDelegate::CreateNonClientFrameView() {
return NULL;
}
+bool WidgetDelegate::WillProcessWorkAreaChange() const {
+ return false;
+}
+
} // namespace views
diff --git a/views/widget/widget_delegate.h b/views/widget/widget_delegate.h
index dac0253..0e34e5b 100644
--- a/views/widget/widget_delegate.h
+++ b/views/widget/widget_delegate.h
@@ -144,6 +144,12 @@ class WidgetDelegate {
// Return NULL to use the default one.
virtual NonClientFrameView* CreateNonClientFrameView();
+ // 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;
+
Window* window() const { return window_; }
protected: