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

Unified Diff: chrome/browser/ui/cocoa/new_tab_button.mm

Issue 2403853002: cocoa browser: remove remaining non-MD code (Closed)
Patch Set: git cl format 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/cocoa/new_tab_button.mm
diff --git a/chrome/browser/ui/cocoa/new_tab_button.mm b/chrome/browser/ui/cocoa/new_tab_button.mm
index 66550701d245f9a62403613f3a84447906b49f7c..3224e675066a5b43bfe63928b6a36589320d1415 100644
--- a/chrome/browser/ui/cocoa/new_tab_button.mm
+++ b/chrome/browser/ui/cocoa/new_tab_button.mm
@@ -34,10 +34,6 @@
const CGFloat k25PercentAlpha = 0.25;
NSImage* GetMaskImageFromCell(NewTabButtonCell* aCell) {
- if (!ui::MaterialDesignController::IsModeMaterial()) {
- ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
- return bundle.GetNativeImageNamed(IDR_NEWTAB_BUTTON_MASK).ToNSImage();
- }
return [aCell imageForState:image_button_cell::kDefaultState view:nil];
}
@@ -253,44 +249,6 @@ - (void)setImages {
return;
}
- // The old way of doing things.
- if (!ui::MaterialDesignController::IsModeMaterial()) {
- ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- NSImage* mask = rb.GetNativeImageNamed(IDR_NEWTAB_BUTTON_MASK).ToNSImage();
- NSImage* normal = rb.GetNativeImageNamed(IDR_NEWTAB_BUTTON).ToNSImage();
- NSImage* hover = rb.GetNativeImageNamed(IDR_NEWTAB_BUTTON_H).ToNSImage();
- NSImage* pressed = rb.GetNativeImageNamed(IDR_NEWTAB_BUTTON_P).ToNSImage();
-
- NSImage* foreground = ApplyMask(
- theme->GetNSImageNamed(IDR_THEME_TAB_BACKGROUND), mask);
-
- [[self cell] setImage:Overlay(foreground, normal, 1.0)
- forButtonState:image_button_cell::kDefaultState];
- [[self cell] setImage:Overlay(foreground, hover, 1.0)
- forButtonState:image_button_cell::kHoverState];
- [[self cell] setImage:Overlay(foreground, pressed, 1.0)
- forButtonState:image_button_cell::kPressedState];
-
- // IDR_THEME_TAB_BACKGROUND_INACTIVE is only used with the default theme.
- if (theme->UsingSystemTheme()) {
- const CGFloat alpha = tabs::kImageNoFocusAlpha;
- NSImage* background = ApplyMask(
- theme->GetNSImageNamed(IDR_THEME_TAB_BACKGROUND_INACTIVE), mask);
- [[self cell] setImage:Overlay(background, normal, alpha)
- forButtonState:
- image_button_cell::kDefaultStateBackground];
- [[self cell] setImage:Overlay(background, hover, alpha)
- forButtonState:image_button_cell::kHoverStateBackground];
- } else {
- [[self cell] setImage:nil
- forButtonState:
- image_button_cell::kDefaultStateBackground];
- [[self cell] setImage:nil
- forButtonState:image_button_cell::kHoverStateBackground];
- }
- return;
- }
-
NSImage* mask = [self imageWithFillColor:[NSColor whiteColor]];
NSImage* normal =
[self imageForState:image_button_cell::kDefaultState theme:theme];
« no previous file with comments | « chrome/browser/ui/cocoa/menu_button.mm ('k') | chrome/browser/ui/cocoa/profiles/avatar_button_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698