Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6734)

Unified Diff: chrome/views/non_client_view.cc

Issue 42062: Merge r11424... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/branches/169/src/
Patch Set: Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/views/non_client_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/views/non_client_view.cc
===================================================================
--- chrome/views/non_client_view.cc (revision 11419)
+++ chrome/views/non_client_view.cc (working copy)
@@ -151,8 +151,21 @@
// ClientView...
frame_view_->SetBounds(0, 0, width(), height());
+ // We need to manually call Layout here because layout for the frame view can
+ // change independently of the bounds changing - e.g. after the initial
+ // display of the window the metrics of the native window controls can change,
+ // which does not change the bounds of the window but requires a re-layout to
+ // trigger a repaint. We override DidChangeBounds for the NonClientFrameView
+ // to do nothing so that SetBounds above doesn't cause Layout to be called
+ // twice.
+ frame_view_->Layout();
+
// Then layout the ClientView, using those bounds.
client_view_->SetBounds(frame_view_->GetBoundsForClientView());
+
+ // We need to manually call Layout on the ClientView as well for the same
+ // reason as above.
+ client_view_->Layout();
}
void NonClientView::ViewHierarchyChanged(bool is_add, View* parent,
@@ -196,6 +209,12 @@
return !GetWidget()->AsWindow()->client_view()->bounds().Contains(l);
}
+void NonClientFrameView::DidChangeBounds(const gfx::Rect& previous,
+ const gfx::Rect& current) {
+ // Overridden to do nothing. The NonClientView manually calls Layout on the
+ // FrameView when it is itself laid out, see comment in NonClientView::Layout.
+}
+
////////////////////////////////////////////////////////////////////////////////
// NonClientFrameView, protected:
« no previous file with comments | « chrome/views/non_client_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698