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

Unified Diff: views/fill_layout.cc

Issue 6245003: Views-implementation of AutocompleteEditView (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 11 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
« views/fill_layout.h ('K') | « views/fill_layout.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/fill_layout.cc
diff --git a/views/fill_layout.cc b/views/fill_layout.cc
index 7bd1430a6804e16b12e36c85f27a8dd5cb1bee06..741f7e834b4080b63f87b8467f40e447ddf38b20 100644
--- a/views/fill_layout.cc
+++ b/views/fill_layout.cc
@@ -11,7 +11,12 @@ namespace views {
///////////////////////////////////////////////////////////////////////////////
// FillLayout
-FillLayout::FillLayout() {
+FillLayout::FillLayout()
+ : exclude_insets_(false) {
+}
+
+FillLayout::FillLayout(bool exclude_insets)
+ : exclude_insets_(exclude_insets) {
}
FillLayout::~FillLayout() {
@@ -22,7 +27,14 @@ void FillLayout::Layout(View* host) {
return;
View* frame_view = host->GetChildViewAt(0);
- frame_view->SetBounds(0, 0, host->width(), host->height());
+ if (exclude_insets_) {
Peter Kasting 2011/01/20 19:44:37 Nit: Simpler: gfx::Insets insets(exclude_insets
+ gfx::Insets insets = host->GetInsets();
+ frame_view->SetBounds(insets.left(), insets.top(),
+ host->width() - insets.width(),
+ host->height() - insets.height());
+ } else {
+ frame_view->SetBounds(0, 0, host->width(), host->height());
+ }
}
gfx::Size FillLayout::GetPreferredSize(View* host) {
« views/fill_layout.h ('K') | « views/fill_layout.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698