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_icon_controller.h" | 5 #import "chrome/browser/ui/cocoa/profiles/avatar_icon_controller.h" |
6 | 6 |
7 #include "base/strings/sys_string_conversions.h" | 7 #include "base/strings/sys_string_conversions.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/profiles/profile_avatar_icon_util.h" | 10 #include "chrome/browser/profiles/profile_avatar_icon_util.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 [cell accessibilitySetOverrideValue: | 94 [cell accessibilitySetOverrideValue: |
95 l10n_util::GetNSString(IDS_PROFILES_BUBBLE_ACCESSIBLE_DESCRIPTION) | 95 l10n_util::GetNSString(IDS_PROFILES_BUBBLE_ACCESSIBLE_DESCRIPTION) |
96 forAttribute:NSAccessibilityHelpAttribute]; | 96 forAttribute:NSAccessibilityHelpAttribute]; |
97 [cell accessibilitySetOverrideValue: | 97 [cell accessibilitySetOverrideValue: |
98 l10n_util::GetNSString(IDS_PROFILES_BUBBLE_ACCESSIBLE_DESCRIPTION) | 98 l10n_util::GetNSString(IDS_PROFILES_BUBBLE_ACCESSIBLE_DESCRIPTION) |
99 forAttribute:NSAccessibilityDescriptionAttribute]; | 99 forAttribute:NSAccessibilityDescriptionAttribute]; |
100 | 100 |
101 Profile* profile = browser_->profile(); | 101 Profile* profile = browser_->profile(); |
102 | 102 |
103 if (profile->IsOffTheRecord() || profile->IsGuestSession()) { | 103 if (profile->IsOffTheRecord() || profile->IsGuestSession()) { |
104 const int icon_id = profile->IsGuestSession() ? IDR_LOGIN_GUEST : | 104 const int icon_id = profile->IsGuestSession() ? |
105 IDR_OTR_ICON; | 105 profiles::GetPlaceholderAvatarIconResourceID() : IDR_OTR_ICON; |
106 NSImage* icon = ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 106 NSImage* icon = ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
107 icon_id).ToNSImage(); | 107 icon_id).ToNSImage(); |
108 [self setImage:[self compositeImageWithShadow:icon]]; | 108 [self setImage:[self compositeImageWithShadow:icon]]; |
109 [self setButtonEnabled:profile->IsGuestSession()]; | 109 [self setButtonEnabled:profile->IsGuestSession()]; |
110 } else { | 110 } else { |
111 [self setButtonEnabled:YES]; | 111 [self setButtonEnabled:YES]; |
112 [self updateAvatarButtonAndLayoutParent:NO]; | 112 [self updateAvatarButtonAndLayoutParent:NO]; |
113 | 113 |
114 // Managed users cannot enter incognito mode, so we only need to check | 114 // Managed users cannot enter incognito mode, so we only need to check |
115 // it in this code path. | 115 // it in this code path. |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 // needs to be adjusted. Since the fullscreen button is positioned by | 234 // needs to be adjusted. Since the fullscreen button is positioned by |
235 // FramedBrowserWindow using private APIs, the easiest way to update the | 235 // FramedBrowserWindow using private APIs, the easiest way to update the |
236 // position of the button is through this private API. Resizing the window | 236 // position of the button is through this private API. Resizing the window |
237 // also works, but invoking |-display| does not. | 237 // also works, but invoking |-display| does not. |
238 NSView* themeFrame = [[[wc window] contentView] superview]; | 238 NSView* themeFrame = [[[wc window] contentView] superview]; |
239 if ([themeFrame respondsToSelector:@selector(_tileTitlebarAndRedisplay:)]) | 239 if ([themeFrame respondsToSelector:@selector(_tileTitlebarAndRedisplay:)]) |
240 [themeFrame _tileTitlebarAndRedisplay:YES]; | 240 [themeFrame _tileTitlebarAndRedisplay:YES]; |
241 } | 241 } |
242 | 242 |
243 @end | 243 @end |
OLD | NEW |