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

Unified Diff: chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm

Issue 440633002: [Mac] Use CommonTheme for the new avatar menu button hover background (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm
diff --git a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm
index 2c62acb7d082ad7d16b4e27bb93e2143f35fe062..3797f25a46307819a03224e162e16fcf22f6f55d 100644
--- a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm
+++ b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm
@@ -60,6 +60,7 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/text_elider.h"
+#include "ui/native_theme/common_theme.h"
#include "ui/native_theme/native_theme.h"
namespace {
@@ -642,9 +643,13 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver,
backgroundColor:(NSColor*)backgroundColor {
if ((self = [super initWithFrame:frameRect])) {
backgroundColor_.reset([backgroundColor retain]);
- hoverColor_.reset([gfx::SkColorToCalibratedNSColor(
- ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_ButtonHoverBackgroundColor)) retain]);
+ // Use a color from the common theme, since this button is not trying to
+ // look like a native control.
+ SkColor hoverColor;
+ bool found = ui::CommonThemeGetSystemColor(
+ ui::NativeTheme::kColorId_ButtonHoverBackgroundColor, &hoverColor);
groby-ooo-7-16 2014/08/06 00:05:25 I wish CommonTheme followed the NativeTheme API an
tapted 2014/08/06 01:49:09 Yeah :/ - I think it's to avoid something special
+ DCHECK(found);
+ hoverColor_.reset([gfx::SkColorToSRGBNSColor(hoverColor) retain]);
tapted 2014/08/04 03:11:47 Note it's using sRGB rather than "Calibrated" here
groby-ooo-7-16 2014/08/06 00:05:24 +1 on fixing the color space. (I believe I suggest
tapted 2014/08/06 01:49:09 Good idea - I think something like https://coderev
[self setBordered:NO];
[self setFont:[NSFont labelFontOfSize:kTextFontSize]];
« 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