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 @@ ...@@ -19,6 +19,7 @@
#include "chrome/browser/ui/cocoa/l10n_util.h" #include "chrome/browser/ui/cocoa/l10n_util.h"
#import "chrome/browser/ui/cocoa/profiles/avatar_button.h" #import "chrome/browser/ui/cocoa/profiles/avatar_button.h"
#include "chrome/grit/generated_resources.h" #include "chrome/grit/generated_resources.h"
#import "chrome/browser/themes/theme_properties.h"
#include "chrome/grit/theme_resources.h" #include "chrome/grit/theme_resources.h"
#include "components/signin/core/common/profile_management_switches.h" #include "components/signin/core/common/profile_management_switches.h"
#include "skia/ext/skia_utils_mac.h" #include "skia/ext/skia_utils_mac.h"
...@@ -251,11 +252,13 @@ const CGFloat kMaterialTitleKern = 0.25; ...@@ -251,11 +252,13 @@ const CGFloat kMaterialTitleKern = 0.25;
} }
- (void)themeDidChangeNotification:(NSNotification*)aNotification { - (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 = ThemeService* themeService =
ThemeServiceFactory::GetForProfile(browser_->profile()); ThemeServiceFactory::GetForProfile(browser_->profile());
BOOL updatedIsThemedWindow = !themeService->UsingSystemTheme(); BOOL updatedIsThemedWindow = !themeService->UsingSystemTheme();
if (isThemedWindow_ != updatedIsThemedWindow) { if (isThemedWindow_ != updatedIsThemedWindow ||
ui::MaterialDesignController::IsModeMaterial()) {
isThemedWindow_ = updatedIsThemedWindow; isThemedWindow_ = updatedIsThemedWindow;
[[button_ cell] setIsThemedWindow:isThemedWindow_]; [[button_ cell] setIsThemedWindow:isThemedWindow_];
[self updateAvatarButtonAndLayoutParent:YES]; [self updateAvatarButtonAndLayoutParent:YES];
...@@ -270,12 +273,16 @@ const CGFloat kMaterialTitleKern = 0.25; ...@@ -270,12 +273,16 @@ const CGFloat kMaterialTitleKern = 0.25;
BOOL isMaterial = ui::MaterialDesignController::IsModeMaterial(); BOOL isMaterial = ui::MaterialDesignController::IsModeMaterial();
NSColor* foregroundColor; NSColor* foregroundColor;
if (browser_->profile()->IsGuestSession() && isMaterial) if (isMaterial) {
foregroundColor = [NSColor colorWithCalibratedWhite:1.0 alpha:0.9]; const ui::ThemeProvider* theme =
else if (!isThemedWindow_) &ThemeService::GetThemeProviderForProfile(browser_->profile());
foregroundColor = [NSColor blackColor]; foregroundColor = theme ? theme->GetNSColor(ThemeProperties::COLOR_TAB_TEXT)
else : [NSColor blackColor];
foregroundColor = [NSColor blackColor]; } else {
foregroundColor = browser_->profile()->IsGuestSession()
? [NSColor colorWithCalibratedWhite:1.0 alpha:0.9]
: [NSColor blackColor];
}
ProfileAttributesStorage& storage = ProfileAttributesStorage& storage =
g_browser_process->profile_manager()->GetProfileAttributesStorage(); 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