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

Unified Diff: chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc

Issue 1322323006: Change toolbar height for material design on Ash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: only changed frame for Ash Created 5 years, 3 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 | « chrome/browser/themes/theme_properties.cc ('k') | chrome/browser/ui/views/toolbar/toolbar_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
index a23f1b8baa9d3964ba69e599c4aa11af9f9b5a07..193e0716d6ae86bbadecaafc67ac096b454bf6d0 100644
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
@@ -633,35 +633,22 @@ void BrowserNonClientFrameViewAsh::PaintToolbarBackground(gfx::Canvas* canvas) {
int w = toolbar_bounds.width();
int y = toolbar_bounds.y();
int h = toolbar_bounds.height();
-
- // Gross hack: We split the toolbar images into two pieces, since sometimes
- // (popup mode) the toolbar isn't tall enough to show the whole image. The
- // split happens between the top shadow section and the bottom gradient
- // section so that we never break the gradient.
- // NOTE(pkotwicz): If the computation for |bottom_y| is changed, Layout() must
- // be changed as well.
- int split_point = kFrameShadowThickness * 2;
- int bottom_y = y + split_point;
ui::ThemeProvider* tp = GetThemeProvider();
- int bottom_edge_height = h - split_point;
-
- canvas->FillRect(gfx::Rect(x, bottom_y, w, bottom_edge_height),
- tp->GetColor(ThemeProperties::COLOR_TOOLBAR));
-
- // Paint the main toolbar image. Since this image is also used to draw the
- // tab background, we must use the tab strip offset to compute the image
- // source y position. If you have to debug this code use an image editor
- // to paint a diagonal line through the toolbar image and ensure it lines up
- // across the tab and toolbar.
- gfx::ImageSkia* theme_toolbar = tp->GetImageSkiaNamed(IDR_THEME_TOOLBAR);
- canvas->TileImageInt(
- *theme_toolbar,
- x + GetThemeBackgroundXInset(),
- bottom_y - GetTopInset(),
- x, bottom_y,
- w, theme_toolbar->height());
if (ui::MaterialDesignController::IsModeMaterial()) {
+ // Paint the main toolbar image. Since this image is also used to draw the
+ // tab background, we must use the tab strip offset to compute the image
+ // source y position. If you have to debug this code use an image editor
+ // to paint a diagonal line through the toolbar image and ensure it lines up
+ // across the tab and toolbar.
+ gfx::ImageSkia* theme_toolbar = tp->GetImageSkiaNamed(IDR_THEME_TOOLBAR);
+ canvas->TileImageInt(
+ *theme_toolbar,
+ x + GetThemeBackgroundXInset(),
+ y - GetTopInset(),
+ x, y,
+ w, theme_toolbar->height());
+
// Draw the content/toolbar separator.
toolbar_bounds.Inset(kClientEdgeThickness, 0);
BrowserView::Paint1pxHorizontalLine(
@@ -670,6 +657,32 @@ void BrowserNonClientFrameViewAsh::PaintToolbarBackground(gfx::Canvas* canvas) {
ThemeProperties::COLOR_TOOLBAR_SEPARATOR),
toolbar_bounds);
} else {
+ // Gross hack: We split the toolbar images into two pieces, since sometimes
+ // (popup mode) the toolbar isn't tall enough to show the whole image. The
+ // split happens between the top shadow section and the bottom gradient
+ // section so that we never break the gradient.
+ // NOTE(pkotwicz): If the computation for |bottom_y| is changed, Layout()
+ // must be changed as well.
+ int split_point = kFrameShadowThickness * 2;
+ int bottom_y = y + split_point;
+ int bottom_edge_height = h - split_point;
+
+ canvas->FillRect(gfx::Rect(x, bottom_y, w, bottom_edge_height),
+ tp->GetColor(ThemeProperties::COLOR_TOOLBAR));
+
+ // Paint the main toolbar image. Since this image is also used to draw the
+ // tab background, we must use the tab strip offset to compute the image
+ // source y position. If you have to debug this code use an image editor
+ // to paint a diagonal line through the toolbar image and ensure it lines up
+ // across the tab and toolbar.
+ gfx::ImageSkia* theme_toolbar = tp->GetImageSkiaNamed(IDR_THEME_TOOLBAR);
+ canvas->TileImageInt(
+ *theme_toolbar,
+ x + GetThemeBackgroundXInset(),
+ bottom_y - GetTopInset(),
+ x, bottom_y,
+ w, theme_toolbar->height());
+
// The pre-material design content area line has a shadow that extends a
// couple of pixels above the toolbar bounds.
const int kContentShadowHeight = 2;
« no previous file with comments | « chrome/browser/themes/theme_properties.cc ('k') | chrome/browser/ui/views/toolbar/toolbar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698