Commit 28f2ba5d authored by spqchan's avatar spqchan Committed by Commit bot

[Material][Mac] Change the User Account Text Color

- Fix the User Account text colors:
  - For themed windows, the text color should be the same as the
   selected tab's title
  - In Guest Mode, the text color should only be white if the browser is
  not using MD

BUG=646060,648890

Review-Url: https://codereview.chromium.org/2369663002
Cr-Commit-Position: refs/heads/master@{#423060}
parent 96a59f82
......@@ -19,6 +19,7 @@
#include "chrome/browser/ui/cocoa/l10n_util.h"
#import "chrome/browser/ui/cocoa/profiles/avatar_button.h"
#include "chrome/grit/generated_resources.h"
#import "chrome/browser/themes/theme_properties.h"
#include "chrome/grit/theme_resources.h"
#include "components/signin/core/common/profile_management_switches.h"
#include "skia/ext/skia_utils_mac.h"
......@@ -251,11 +252,13 @@ const CGFloat kMaterialTitleKern = 0.25;
}
- (void)themeDidChangeNotification:(NSNotification*)aNotification {
// Redraw the button if the window has switched between themed and native.
// Redraw the button if the window has switched between themed and native
// or if we're in MD design.
ThemeService* themeService =
ThemeServiceFactory::GetForProfile(browser_->profile());
BOOL updatedIsThemedWindow = !themeService->UsingSystemTheme();
if (isThemedWindow_ != updatedIsThemedWindow) {
if (isThemedWindow_ != updatedIsThemedWindow ||
ui::MaterialDesignController::IsModeMaterial()) {
isThemedWindow_ = updatedIsThemedWindow;
[[button_ cell] setIsThemedWindow:isThemedWindow_];
[self updateAvatarButtonAndLayoutParent:YES];
......@@ -270,12 +273,16 @@ const CGFloat kMaterialTitleKern = 0.25;
BOOL isMaterial = ui::MaterialDesignController::IsModeMaterial();
NSColor* foregroundColor;
if (browser_->profile()->IsGuestSession() && isMaterial)
foregroundColor = [NSColor colorWithCalibratedWhite:1.0 alpha:0.9];
else if (!isThemedWindow_)
foregroundColor = [NSColor blackColor];
else
foregroundColor = [NSColor blackColor];
if (isMaterial) {
const ui::ThemeProvider* theme =
&ThemeService::GetThemeProviderForProfile(browser_->profile());
foregroundColor = theme ? theme->GetNSColor(ThemeProperties::COLOR_TAB_TEXT)
: [NSColor blackColor];
} else {
foregroundColor = browser_->profile()->IsGuestSession()
? [NSColor colorWithCalibratedWhite:1.0 alpha:0.9]
: [NSColor blackColor];
}
ProfileAttributesStorage& storage =
g_browser_process->profile_manager()->GetProfileAttributesStorage();
......
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