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

Unified Diff: chrome/browser/ui/views/constrained_window_frame_simple.cc

Issue 11421164: Migrate CollectedCookiesViews to Chrome style. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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: 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;
« no previous file with comments | « chrome/browser/ui/views/constrained_window_frame_simple.h ('k') | chrome/browser/ui/views/constrained_window_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698