Commit a71ca0b8 authored by tapted@chromium.org's avatar tapted@chromium.org

[Mac] Use CommonTheme for the new avatar menu button hover background

As of r286651, NativeThemeMac now provides user-configurable system
colours for better OS integration. However, these are not needed for
dialogs that aren't trying to look native.

This change gets the button hover background used for the new avatar
menu from CommonTheme instead, to get a cross-platform look.

BUG=399820
TEST=On Mac, run Chrome with --new-avatar-menu and open the avatar
drop-down; hovering over the "Not xxx?" item should switch to a gray
background.

Review URL: https://codereview.chromium.org/440633002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287725 0039d316-1c4b-4281-b951-d872f2087c98
parent e71d0614
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image.h" #include "ui/gfx/image/image.h"
#include "ui/gfx/text_elider.h" #include "ui/gfx/text_elider.h"
#include "ui/native_theme/common_theme.h"
#include "ui/native_theme/native_theme.h" #include "ui/native_theme/native_theme.h"
namespace { namespace {
...@@ -645,9 +646,13 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, ...@@ -645,9 +646,13 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver,
backgroundColor:(NSColor*)backgroundColor { backgroundColor:(NSColor*)backgroundColor {
if ((self = [super initWithFrame:frameRect])) { if ((self = [super initWithFrame:frameRect])) {
backgroundColor_.reset([backgroundColor retain]); backgroundColor_.reset([backgroundColor retain]);
hoverColor_.reset([gfx::SkColorToCalibratedNSColor( // Use a color from the common theme, since this button is not trying to
ui::NativeTheme::instance()->GetSystemColor( // look like a native control.
ui::NativeTheme::kColorId_ButtonHoverBackgroundColor)) retain]); SkColor hoverColor;
bool found = ui::CommonThemeGetSystemColor(
ui::NativeTheme::kColorId_ButtonHoverBackgroundColor, &hoverColor);
DCHECK(found);
hoverColor_.reset([gfx::SkColorToSRGBNSColor(hoverColor) retain]);
[self setBordered:NO]; [self setBordered:NO];
[self setFont:[NSFont labelFontOfSize:kTextFontSize]]; [self setFont:[NSFont labelFontOfSize:kTextFontSize]];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment