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

Unified Diff: ash/frame/header_painter_util.cc

Issue 441803004: Introduce new WebApp header style for hosted apps and fizzy apps on ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 4 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 | « ash/frame/header_painter_util.h ('k') | ash/resources/ash_resources.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/frame/header_painter_util.cc
diff --git a/ash/frame/header_painter_util.cc b/ash/frame/header_painter_util.cc
index 1054291848198ea8e8bf505252d2d3ec162024b0..8d5aac1155dd5b07bf55150a757f244008986b6f 100644
--- a/ash/frame/header_painter_util.cc
+++ b/ash/frame/header_painter_util.cc
@@ -19,11 +19,8 @@ namespace {
// Radius of the header's top corners when the window is restored.
const int kTopCornerRadiusWhenRestored = 2;
-// Distance between left edge of the window and the header icon.
-const int kIconXOffset = 9;
-
-// Default height and width of header icon.
-const int kDefaultIconSize = 16;
+// Distance between left edge of the window and the leftmost view.
+const int kDefaultLeftViewXInset = 9;
// Space between the title text and the caption buttons.
const int kTitleCaptionButtonSpacing = 5;
@@ -52,13 +49,8 @@ int HeaderPainterUtil::GetTopCornerRadiusWhenRestored() {
}
// static
-int HeaderPainterUtil::GetIconXOffset() {
- return kIconXOffset;
-}
-
-// static
-int HeaderPainterUtil::GetDefaultIconSize() {
- return kDefaultIconSize;
+int HeaderPainterUtil::GetDefaultLeftViewXInset() {
+ return kDefaultLeftViewXInset;
}
// static
@@ -68,17 +60,16 @@ int HeaderPainterUtil::GetThemeBackgroundXInset() {
// static
gfx::Rect HeaderPainterUtil::GetTitleBounds(
- const views::View* icon,
- const views::View* caption_button_container,
+ const views::View* left_view,
+ const views::View* right_view,
const gfx::FontList& title_font_list) {
- int x = icon ?
- icon->bounds().right() + kTitleIconOffsetX : kTitleNoIconOffsetX;
+ int x = left_view ? left_view->bounds().right() + kTitleIconOffsetX
+ : kTitleNoIconOffsetX;
int height = title_font_list.GetHeight();
// Floor when computing the center of |caption_button_container| and when
// computing the center of the text.
- int y = std::max(0, (caption_button_container->height() / 2) - (height / 2));
- int width = std::max(
- 0, caption_button_container->x() - kTitleCaptionButtonSpacing - x);
+ int y = std::max(0, (right_view->height() / 2) - (height / 2));
+ int width = std::max(0, right_view->x() - kTitleCaptionButtonSpacing - x);
return gfx::Rect(x, y, width, height);
}
« no previous file with comments | « ash/frame/header_painter_util.h ('k') | ash/resources/ash_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698