Index: chrome/browser/ui/views/constrained_window_frame_simple.cc |
diff --git a/chrome/browser/ui/views/constrained_window_frame_simple.cc b/chrome/browser/ui/views/constrained_window_frame_simple.cc |
index cd1dc25e22610e0b1258444676289ec12cd52e3c..64ef94e2d34a1d258e14147b7d06f92cdd3dbb15 100644 |
--- a/chrome/browser/ui/views/constrained_window_frame_simple.cc |
+++ b/chrome/browser/ui/views/constrained_window_frame_simple.cc |
@@ -28,9 +28,9 @@ |
ConstrainedWindowFrameSimple::ConstrainedWindowFrameSimple( |
ConstrainedWindowViews* container, |
- ConstrainedWindowViews::ChromeStyleClientInsets client_insets) |
+ ConstrainedWindowViews::ChromeStyleFrameLayout frame_layout) |
: container_(container), |
- client_insets_(client_insets), |
+ frame_layout_(frame_layout), |
title_label_(NULL), |
close_button_(NULL), |
bottom_margin_(0) { |
@@ -43,9 +43,9 @@ ConstrainedWindowFrameSimple::ConstrainedWindowFrameSimple( |
set_border(views::Border::CreateEmptyBorder(0, 0, 0, 0)); |
#endif |
- // The NO_INSETS consumers draw atop the frame and do not get the close button |
- // and title label below. |
- if (client_insets_ == ConstrainedWindowViews::NO_INSETS) |
+ // The FRAME_LAYOUT_NONE consumers draw atop the frame and do not get the |
+ // close button and title label below. |
+ if (frame_layout_ == ConstrainedWindowViews::FRAME_LAYOUT_NONE) |
return; |
gfx::Insets border_insets = border()->GetInsets(); |
@@ -111,19 +111,26 @@ gfx::Insets ConstrainedWindowFrameSimple::GetClientInsets() const { |
if (border()) |
insets += border()->GetInsets(); |
- if (client_insets_ == ConstrainedWindowViews::DEFAULT_INSETS) { |
+ if (frame_layout_ == ConstrainedWindowViews::FRAME_LAYOUT_FULL || |
+ frame_layout_ == ConstrainedWindowViews::FRAME_LAYOUT_HEADER_ONLY) { |
const int kHeaderTopPadding = std::min( |
ConstrainedWindowConstants::kCloseButtonPadding, |
ConstrainedWindowConstants::kTitleTopPadding); |
const int kTitleBuiltinBottomPadding = 4; |
+ const int kClientHorizontalPadding = |
+ frame_layout_ == ConstrainedWindowViews::FRAME_LAYOUT_FULL ? |
+ ConstrainedWindowConstants::kHorizontalPadding : 0; |
+ const int kClientBottomPadding = |
+ frame_layout_ == ConstrainedWindowViews::FRAME_LAYOUT_FULL ? |
+ ConstrainedWindowConstants::kClientBottomPadding - bottom_margin_ : 0; |
insets += gfx::Insets( |
ConstrainedWindowConstants::kClientTopPadding + kHeaderTopPadding + |
std::max(close_button_->GetPreferredSize().height(), |
title_label_->GetPreferredSize().height()) - |
kTitleBuiltinBottomPadding, |
- ConstrainedWindowConstants::kHorizontalPadding, |
- ConstrainedWindowConstants::kClientBottomPadding - bottom_margin_, |
- ConstrainedWindowConstants::kHorizontalPadding); |
+ kClientHorizontalPadding, |
+ kClientBottomPadding, |
+ kClientHorizontalPadding); |
} |
return insets; |