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

Unified Diff: chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.mm

Issue 2614333002: Revert of Create vector icon resource directory specific to Chrome. (Closed)
Patch Set: Created 3 years, 11 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/toolbar/toolbar_button_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.mm b/chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.mm
index 1953c44227136105114b943a6979e3a7be2827f5..a850b3a0d2726fd5d576121d154f3afc3c4368de 100644
--- a/chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.mm
+++ b/chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.mm
@@ -6,7 +6,6 @@
#include "base/mac/foundation_util.h"
#include "base/mac/sdk_forward_declarations.h"
-#include "chrome/app/vector_icons/vector_icons.h"
#import "chrome/browser/ui/cocoa/image_button_cell.h"
#import "chrome/browser/ui/cocoa/l10n_util.h"
#import "chrome/browser/ui/cocoa/view_id_util.h"
@@ -205,22 +204,24 @@
yRadius:2] fill];
}
-- (const gfx::VectorIcon*)vectorIcon {
+- (gfx::VectorIconId)vectorIconId {
BOOL isRTL = cocoa_l10n_util::ShouldDoExperimentalRTLLayout();
switch ([self viewID]) {
case VIEW_ID_BACK_BUTTON:
- return isRTL ? &kNavigateForwardIcon : &kNavigateBackIcon;
+ return isRTL ? gfx::VectorIconId::NAVIGATE_FORWARD
+ : gfx::VectorIconId::NAVIGATE_BACK;
case VIEW_ID_FORWARD_BUTTON:
- return isRTL ? &kNavigateBackIcon : &kNavigateForwardIcon;
+ return isRTL ? gfx::VectorIconId::NAVIGATE_BACK
+ : gfx::VectorIconId::NAVIGATE_FORWARD;
case VIEW_ID_HOME_BUTTON:
- return &kNavigateHomeIcon;
+ return gfx::VectorIconId::NAVIGATE_HOME;
case VIEW_ID_APP_MENU:
- return &kBrowserToolsIcon;
+ return gfx::VectorIconId::BROWSER_TOOLS;
default:
break;
}
- return nullptr;
+ return gfx::VectorIconId::VECTOR_ICON_NONE;
}
- (SkColor)vectorIconColor:(BOOL)themeIsDark {
@@ -285,9 +286,9 @@
NSImage* disabledIcon = nil;
BOOL isDarkTheme = NO;
- const gfx::VectorIcon* icon = [self vectorIcon];
- if (!icon) {
- // If the button does not have a vector icon (e.g. it's an extension
+ gfx::VectorIconId iconId = [self vectorIconId];
+ if (iconId == gfx::VectorIconId::VECTOR_ICON_NONE) {
+ // If the button does not have a vector icon id (e.g. it's an extension
// button), use its image. The hover, etc. images will be created using
// imageForIcon:withBackgroundStyle: so do the same for the default image.
// If we don't do this, the icon may not appear in the same place as in the
@@ -307,19 +308,19 @@
// Create the normal and disabled state icons. These icons are always the
// same shape but use a different color.
- if (icon == &kBrowserToolsIcon) {
+ if (iconId == gfx::VectorIconId::BROWSER_TOOLS) {
normalIcon = [self browserToolsIconForFillColor:normalColor];
disabledIcon = [self browserToolsIconForFillColor:disabledColor];
} else {
normalIcon = NSImageFromImageSkia(
- gfx::CreateVectorIcon(*icon,
+ gfx::CreateVectorIcon(iconId,
kMDButtonIconSize.width,
normalColor));
// The home button has no icon for its disabled state.
- if (icon != &kNavigateReloadIcon) {
+ if (iconId != gfx::VectorIconId::NAVIGATE_RELOAD) {
disabledIcon = NSImageFromImageSkia(
- gfx::CreateVectorIcon(*icon,
+ gfx::CreateVectorIcon(iconId,
kMDButtonIconSize.width,
disabledColor));
}
« no previous file with comments | « chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.h ('k') | chrome/browser/ui/global_error/global_error.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698