summaryrefslogtreecommitdiffstats
path: root/chrome/views
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-01 02:05:07 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-01 02:05:07 +0000
commit7f5e84dd9a86e0efcbdd0bf6c35b4f0ecaff58d9 (patch)
treead15eba0d1f291c352a4ce0ddc5fed5ca0f8d61c /chrome/views
parenta2ebc68fd35bf1cfb955a6185b9af84acb1a79a3 (diff)
downloadchromium_src-7f5e84dd9a86e0efcbdd0bf6c35b4f0ecaff58d9.zip
chromium_src-7f5e84dd9a86e0efcbdd0bf6c35b4f0ecaff58d9.tar.gz
chromium_src-7f5e84dd9a86e0efcbdd0bf6c35b4f0ecaff58d9.tar.bz2
Fix distributor logo placement on glass frame when window is restored from fullscreen.
Force a layout in WM_NCCALCSIZE since NC metrics can change as a result of handling this message. http://crbug.com/8511 Review URL: http://codereview.chromium.org/56086 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12930 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views')
-rw-r--r--chrome/views/window/non_client_view.cc22
-rw-r--r--chrome/views/window/non_client_view.h5
2 files changed, 18 insertions, 9 deletions
diff --git a/chrome/views/window/non_client_view.cc b/chrome/views/window/non_client_view.cc
index 327656b..bc69587 100644
--- a/chrome/views/window/non_client_view.cc
+++ b/chrome/views/window/non_client_view.cc
@@ -112,15 +112,7 @@ void NonClientView::ResetWindowControls() {
frame_view_->ResetWindowControls();
}
-////////////////////////////////////////////////////////////////////////////////
-// NonClientView, View overrides:
-
-gfx::Size NonClientView::GetPreferredSize() {
- gfx::Rect client_bounds(gfx::Point(), client_view_->GetPreferredSize());
- return GetWindowBoundsForClientBounds(client_bounds).size();
-}
-
-void NonClientView::Layout() {
+void NonClientView::LayoutFrameView() {
// First layout the NonClientFrameView, which determines the size of the
// ClientView...
frame_view_->SetBounds(0, 0, width(), height());
@@ -133,6 +125,18 @@ void NonClientView::Layout() {
// to do nothing so that SetBounds above doesn't cause Layout to be called
// twice.
frame_view_->Layout();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// NonClientView, View overrides:
+
+gfx::Size NonClientView::GetPreferredSize() {
+ gfx::Rect client_bounds(gfx::Point(), client_view_->GetPreferredSize());
+ return GetWindowBoundsForClientBounds(client_bounds).size();
+}
+
+void NonClientView::Layout() {
+ LayoutFrameView();
// Then layout the ClientView, using those bounds.
client_view_->SetBounds(frame_view_->GetBoundsForClientView());
diff --git a/chrome/views/window/non_client_view.h b/chrome/views/window/non_client_view.h
index 45a089f..0481cfd 100644
--- a/chrome/views/window/non_client_view.h
+++ b/chrome/views/window/non_client_view.h
@@ -185,6 +185,11 @@ class NonClientView : public View {
client_view_ = client_view;
}
+ // Layout just the frame view. This is necessary on Windows when non-client
+ // metrics such as the position of the window controls changes independently
+ // of a window resize message.
+ void LayoutFrameView();
+
// NonClientView, View overrides:
virtual gfx::Size GetPreferredSize();
virtual void Layout();