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

Side by Side Diff: chrome/browser/ui/cocoa/toolbar/app_toolbar_button.mm

Issue 1815313002: Use colors from color_palette.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/toolbar/app_toolbar_button.h" 5 #import "chrome/browser/ui/cocoa/toolbar/app_toolbar_button.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #import "chrome/browser/ui/cocoa/themed_window.h" 8 #import "chrome/browser/ui/cocoa/themed_window.h"
9 #import "chrome/browser/ui/cocoa/view_id_util.h" 9 #import "chrome/browser/ui/cocoa/view_id_util.h"
10 #include "ui/gfx/color_palette.h"
10 11
11 class AppMenuButtonIconPainterDelegateMac : 12 class AppMenuButtonIconPainterDelegateMac :
12 public AppMenuIconPainter::Delegate { 13 public AppMenuIconPainter::Delegate {
13 public: 14 public:
14 explicit AppMenuButtonIconPainterDelegateMac(NSButton* button) : 15 explicit AppMenuButtonIconPainterDelegateMac(NSButton* button) :
15 button_(button) {} 16 button_(button) {}
16 ~AppMenuButtonIconPainterDelegateMac() override {} 17 ~AppMenuButtonIconPainterDelegateMac() override {}
17 18
18 void ScheduleAppMenuIconPaint() override { 19 void ScheduleAppMenuIconPaint() override {
19 [button_ setNeedsDisplay:YES]; 20 [button_ setNeedsDisplay:YES];
(...skipping 26 matching lines...) Expand all
46 view_id_util::SetID(self, VIEW_ID_APP_MENU); 47 view_id_util::SetID(self, VIEW_ID_APP_MENU);
47 delegate_.reset(new AppMenuButtonIconPainterDelegateMac(self)); 48 delegate_.reset(new AppMenuButtonIconPainterDelegateMac(self));
48 severity_ = AppMenuIconPainter::Severity::SEVERITY_NONE; 49 severity_ = AppMenuIconPainter::Severity::SEVERITY_NONE;
49 } 50 }
50 51
51 - (gfx::VectorIconId)vectorIconId { 52 - (gfx::VectorIconId)vectorIconId {
52 return gfx::VectorIconId::BROWSER_TOOLS; 53 return gfx::VectorIconId::BROWSER_TOOLS;
53 } 54 }
54 55
55 - (SkColor)vectorIconColor:(BOOL)themeIsDark { 56 - (SkColor)vectorIconColor:(BOOL)themeIsDark {
56 const SkColor normalColor = SkColorSetRGB(0x5A, 0x5A, 0x5A);
57 const SkColor normalIncognitoColor = SkColorSetRGB(0xFF, 0xFF, 0xFF);
58 const SkColor severityMedColor = SkColorSetRGB(0xF0, 0x93, 0x00);
59 const SkColor severityMedIncognitoColor = SkColorSetRGB(0xF7, 0xCB, 0x4D);
60 const SkColor severityHighColor = SkColorSetRGB(0xC5, 0x39, 0x29);
61 const SkColor severityHighIncognitoColor = SkColorSetRGB(0xE6, 0x73, 0x7C);
62
63 switch (severity_) { 57 switch (severity_) {
64 case AppMenuIconPainter::Severity::SEVERITY_NONE: 58 case AppMenuIconPainter::Severity::SEVERITY_NONE:
65 case AppMenuIconPainter::Severity::SEVERITY_LOW: 59 case AppMenuIconPainter::Severity::SEVERITY_LOW:
66 return themeIsDark ? normalIncognitoColor : normalColor; 60 return themeIsDark ? SK_ColorWHITE : gfx::kChromeIconGrey;
67 break; 61 break;
68 62
69 case AppMenuIconPainter::Severity::SEVERITY_MEDIUM: 63 case AppMenuIconPainter::Severity::SEVERITY_MEDIUM:
70 return themeIsDark ? severityMedIncognitoColor : severityMedColor; 64 return themeIsDark ? gfx::kGoogleYellow300 : gfx::kGoogleYellow700;
71 break; 65 break;
72 66
73 case AppMenuIconPainter::Severity::SEVERITY_HIGH: 67 case AppMenuIconPainter::Severity::SEVERITY_HIGH:
74 return themeIsDark ? severityHighIncognitoColor : severityHighColor; 68 return themeIsDark ? gfx::kGoogleRed300 : gfx::kGoogleRed700;
75 break; 69 break;
76 70
77 default: 71 default:
78 break; 72 break;
79 } 73 }
80 } 74 }
81 75
82 - (void)setSeverity:(AppMenuIconPainter::Severity)severity 76 - (void)setSeverity:(AppMenuIconPainter::Severity)severity
83 shouldAnimate:(BOOL)shouldAnimate { 77 shouldAnimate:(BOOL)shouldAnimate {
84 if (severity != severity_) { 78 if (severity != severity_) {
85 severity_ = severity; 79 severity_ = severity;
86 // Update the button state images with the new severity color. 80 // Update the button state images with the new severity color.
87 [self resetButtonStateImages]; 81 [self resetButtonStateImages];
88 } 82 }
89 } 83 }
90 84
91 @end 85 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698