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

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

Issue 2441863002: Remove some more !IsModeMaterial code. (Closed)
Patch Set: restore Created 4 years, 2 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
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 ae5b211224d59f92fc12a3838320031aad01b3d4..ff746c8928b56b24aad2291d4b3668f07e5ae3c3 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;
@@ -259,11 +245,8 @@ void PaintBackgroundAttachedMode(gfx::Canvas* canvas,
const gfx::Point& background_origin) {
canvas->DrawColor(theme_provider->GetColor(ThemeProperties::COLOR_TOOLBAR));
- // Always tile the background image in pre-MD. In MD, only tile if there's a
- // non-default image.
- // TODO(estade): remove IDR_THEME_TOOLBAR when MD is default.
- if (theme_provider->HasCustomImage(IDR_THEME_TOOLBAR) ||
- !ui::MaterialDesignController::IsModeMaterial()) {
+ // If there's a non-default background image, tile it.
+ if (theme_provider->HasCustomImage(IDR_THEME_TOOLBAR)) {
canvas->TileImageInt(*theme_provider->GetImageSkiaNamed(IDR_THEME_TOOLBAR),
background_origin.x(),
background_origin.y(),
@@ -272,52 +255,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 +1901,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.
« no previous file with comments | « chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.cc ('k') | chrome/browser/ui/views/tabs/tab.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698