OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/profiles/avatar_button_controller.h" | 5 #import "chrome/browser/ui/cocoa/profiles/avatar_button_controller.h" |
6 | 6 |
7 #include "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
9 #include "chrome/browser/profiles/profiles_state.h" | 9 #include "chrome/browser/profiles/profiles_state.h" |
10 #include "chrome/browser/themes/theme_service.h" | 10 #include "chrome/browser/themes/theme_service.h" |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 } else if (!isThemedWindow_) { | 201 } else if (!isThemedWindow_) { |
202 foregroundColor = [NSColor blackColor]; | 202 foregroundColor = [NSColor blackColor]; |
203 [shadow setShadowColor:[NSColor colorWithCalibratedWhite:1.0 alpha:0.7]]; | 203 [shadow setShadowColor:[NSColor colorWithCalibratedWhite:1.0 alpha:0.7]]; |
204 } else { | 204 } else { |
205 foregroundColor = [NSColor blackColor]; | 205 foregroundColor = [NSColor blackColor]; |
206 [shadow setShadowColor:[NSColor colorWithCalibratedWhite:1.0 alpha:0.4]]; | 206 [shadow setShadowColor:[NSColor colorWithCalibratedWhite:1.0 alpha:0.4]]; |
207 } | 207 } |
208 | 208 |
209 base::string16 profileName = [self getElidedAvatarName]; | 209 base::string16 profileName = [self getElidedAvatarName]; |
210 NSString* buttonTitle = nil; | 210 NSString* buttonTitle = nil; |
211 if (browser_->profile()->IsManaged()) { | 211 if (browser_->profile()->IsSupervised()) { |
212 // Add the "supervised" label after eliding the profile name, so the label | 212 // Add the "supervised" label after eliding the profile name, so the label |
213 // will not get elided, but will instead enlarge the button. | 213 // will not get elided, but will instead enlarge the button. |
214 buttonTitle = l10n_util::GetNSStringF(IDS_MANAGED_USER_NEW_AVATAR_LABEL, | 214 buttonTitle = l10n_util::GetNSStringF(IDS_MANAGED_USER_NEW_AVATAR_LABEL, |
215 profileName); | 215 profileName); |
216 } else { | 216 } else { |
217 buttonTitle = base::SysUTF16ToNSString(profileName); | 217 buttonTitle = base::SysUTF16ToNSString(profileName); |
218 } | 218 } |
219 | 219 |
220 base::scoped_nsobject<NSMutableParagraphStyle> paragraphStyle( | 220 base::scoped_nsobject<NSMutableParagraphStyle> paragraphStyle( |
221 [[NSMutableParagraphStyle alloc] init]); | 221 [[NSMutableParagraphStyle alloc] init]); |
(...skipping 11 matching lines...) Expand all Loading... |
233 if (layoutParent) { | 233 if (layoutParent) { |
234 // Because the width of the button might have changed, the parent browser | 234 // Because the width of the button might have changed, the parent browser |
235 // frame needs to recalculate the button bounds and redraw it. | 235 // frame needs to recalculate the button bounds and redraw it. |
236 [[BrowserWindowController | 236 [[BrowserWindowController |
237 browserWindowControllerForWindow:browser_->window()->GetNativeWindow()] | 237 browserWindowControllerForWindow:browser_->window()->GetNativeWindow()] |
238 layoutSubviews]; | 238 layoutSubviews]; |
239 } | 239 } |
240 } | 240 } |
241 | 241 |
242 @end | 242 @end |
OLD | NEW |