Chromium Code Reviews| Index: chrome/browser/ui/views/frame/browser_view.cc |
| diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc |
| index c914f155c039f57d574b2129da9b2c72a1c74e9f..26369381eaa66598b4b8931cb5d799a0c2877c1d 100644 |
| --- a/chrome/browser/ui/views/frame/browser_view.cc |
| +++ b/chrome/browser/ui/views/frame/browser_view.cc |
| @@ -201,25 +201,15 @@ const int kLoadingAnimationFrameTimeMs = 30; |
| // Paints the horizontal border separating the Bookmarks Bar from the Toolbar |
| // or page content according to |at_top| with |color|. |
| -void PaintHorizontalBorder(gfx::Canvas* canvas, |
| - BookmarkBarView* view, |
| - bool at_top, |
| - SkColor color) { |
| - int thickness = views::NonClientFrameView::kClientEdgeThickness; |
| - int y = at_top ? 0 : (view->height() - thickness); |
| - canvas->FillRect(gfx::Rect(0, y, view->width(), thickness), color); |
| -} |
| - |
| void PaintDetachedBookmarkBar(gfx::Canvas* canvas, |
| BookmarkBarView* view) { |
| // Paint background for detached state; if animating, this is fade in/out. |
| const ui::ThemeProvider* tp = view->GetThemeProvider(); |
| gfx::Rect fill_rect = view->GetLocalBounds(); |
| - // In MD, we have to not color the top 1dp, because that should be painted by |
| - // the toolbar. We will, however, paint the 1px separator at the bottom of the |
| + // We have to not color the top 1dp, because that should be painted by the |
| + // toolbar. We will, however, paint the 1px separator at the bottom of the |
| // first dp. See crbug.com/610359 |
| - if (ui::MaterialDesignController::IsModeMaterial()) |
| - fill_rect.Inset(0, 1, 0, 0); |
| + fill_rect.Inset(0, 1, 0, 0); |
| // In detached mode, the bar is meant to overlap with |contents_container_|. |
| // The detached background color may be partially transparent, but the layer |
| @@ -236,10 +226,6 @@ void PaintDetachedBookmarkBar(gfx::Canvas* canvas, |
| SkColor separator_color = |
| tp->GetColor(ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_SEPARATOR); |
| - // In material mode the toolbar bottom stroke serves as our top stroke. |
| - if (!ui::MaterialDesignController::IsModeMaterial()) |
| - PaintHorizontalBorder(canvas, view, true, separator_color); |
| - |
| // For the bottom separator, increase the luminance. Either double it or halve |
| // the distance to 1.0, whichever is less of a difference. |
| color_utils::HSL hsl; |
| @@ -261,9 +247,7 @@ void PaintBackgroundAttachedMode(gfx::Canvas* canvas, |
| // Always tile the background image in pre-MD. In MD, only tile if there's a |
| // non-default image. |
|
Peter Kasting
2016/10/21 21:07:50
Nit: Update comment
Evan Stade
2016/10/21 22:11:12
Done.
|
| - // TODO(estade): remove IDR_THEME_TOOLBAR when MD is default. |
|
Peter Kasting
2016/10/21 21:07:50
Not sure what this meant
Evan Stade
2016/10/21 22:11:12
it meant the asset could be removed (i.e. what thi
|
| - if (theme_provider->HasCustomImage(IDR_THEME_TOOLBAR) || |
| - !ui::MaterialDesignController::IsModeMaterial()) { |
| + if (theme_provider->HasCustomImage(IDR_THEME_TOOLBAR)) { |
| canvas->TileImageInt(*theme_provider->GetImageSkiaNamed(IDR_THEME_TOOLBAR), |
| background_origin.x(), |
| background_origin.y(), |
| @@ -272,52 +256,23 @@ void PaintBackgroundAttachedMode(gfx::Canvas* canvas, |
| bounds.width(), |
| bounds.height()); |
| } |
| - |
| -#if defined(USE_ASH) |
| - if (!ui::MaterialDesignController::IsModeMaterial()) { |
| - // The pre-material design version of Ash provides additional lightening |
| - // at the edges of the toolbar. |
| - gfx::ImageSkia* toolbar_left = |
| - theme_provider->GetImageSkiaNamed(IDR_TOOLBAR_SHADE_LEFT); |
| - canvas->TileImageInt(*toolbar_left, |
| - bounds.x(), |
| - bounds.y(), |
| - toolbar_left->width(), |
| - bounds.height()); |
| - gfx::ImageSkia* toolbar_right = |
| - theme_provider->GetImageSkiaNamed(IDR_TOOLBAR_SHADE_RIGHT); |
| - canvas->TileImageInt(*toolbar_right, |
| - bounds.right() - toolbar_right->width(), |
| - bounds.y(), |
| - toolbar_right->width(), |
| - bounds.height()); |
| - } |
| -#endif // USE_ASH |
| } |
| void PaintAttachedBookmarkBar(gfx::Canvas* canvas, |
| BookmarkBarView* view, |
| BrowserView* browser_view, |
| int toolbar_overlap) { |
| - // Paint background for attached state, this is fade in/out. |
| + // Paint background for attached state. |
| gfx::Point background_image_offset = |
| browser_view->OffsetPointForToolbarBackgroundImage( |
| gfx::Point(view->GetMirroredX(), view->y())); |
| PaintBackgroundAttachedMode(canvas, view->GetThemeProvider(), |
| view->GetLocalBounds(), background_image_offset); |
| if (view->height() >= toolbar_overlap) { |
| - // Draw the separator below the Bookmarks Bar; this is fading in/out. |
| - if (ui::MaterialDesignController::IsModeMaterial()) { |
| - BrowserView::Paint1pxHorizontalLine( |
| - canvas, view->GetThemeProvider()->GetColor( |
| - ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR), |
| - view->GetLocalBounds(), true); |
| - } else { |
| - PaintHorizontalBorder( |
| - canvas, view, false, |
| - view->GetThemeProvider()->GetColor( |
| - ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR)); |
| - } |
| + BrowserView::Paint1pxHorizontalLine( |
| + canvas, view->GetThemeProvider()->GetColor( |
| + ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR), |
| + view->GetLocalBounds(), true); |
| } |
| } |
| @@ -1947,8 +1902,7 @@ void BrowserView::GetAccessibleState(ui::AXViewState* state) { |
| } |
| void BrowserView::OnThemeChanged() { |
| - if (!IsRegularOrGuestSession() && |
| - ui::MaterialDesignController::IsModeMaterial()) { |
| + if (!IsRegularOrGuestSession()) { |
| // When the theme changes, the native theme may also change (in incognito, |
| // the usage of dark or normal hinges on the browser theme), so we have to |
| // propagate both kinds of change. |