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

Unified Diff: views/widget/widget_win.cc

Issue 304007: Make sure the RootView is sized to the correct bounds when the opaque frame i... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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
Index: views/widget/widget_win.cc
===================================================================
--- views/widget/widget_win.cc (revision 29799)
+++ views/widget/widget_win.cc (working copy)
@@ -834,6 +834,16 @@
SetMsgHandled(FALSE);
}
+gfx::Size WidgetWin::GetRootViewSize() const {
+ CRect rect;
+ if (use_layered_buffer_)
+ GetWindowRect(&rect);
+ else
+ GetClientRect(&rect);
+
+ return gfx::Size(rect.Width(), rect.Height());
+}
+
///////////////////////////////////////////////////////////////////////////////
// WidgetWin, protected:
@@ -950,23 +960,18 @@
}
void WidgetWin::LayoutRootView() {
- CRect rect;
- if (SizeRootViewToWindowRect() || use_layered_buffer_) {
- GetWindowRect(&rect);
- } else {
- GetClientRect(&rect);
- }
+ gfx::Size size = GetRootViewSize();
Peter Kasting 2009/10/23 05:09:31 Nit: Constructor style?
if (use_layered_buffer_)
- SizeContents(rect);
+ SizeContents(size);
// Resizing changes the size of the view hierarchy and thus forces a
// complete relayout.
- root_view_->SetBounds(0, 0, rect.Width(), rect.Height());
+ root_view_->SetBounds(0, 0, size.width(), size.height());
root_view_->SchedulePaint();
if (use_layered_buffer_)
- PaintNow(gfx::Rect(rect));
+ PaintNow(gfx::Rect(0, 0, size.width(), size.height()));
}
bool WidgetWin::ReleaseCaptureOnMouseReleased() {
@@ -995,9 +1000,9 @@
return NULL;
}
-void WidgetWin::SizeContents(const CRect& window_rect) {
- contents_.reset(new gfx::Canvas(window_rect.Width(),
- window_rect.Height(),
+void WidgetWin::SizeContents(const gfx::Size& window_size) {
+ contents_.reset(new gfx::Canvas(window_size.width(),
+ window_size.height(),
false));
}

Powered by Google App Engine
This is Rietveld 408576698