Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Side by Side Diff: trunk/src/chrome/browser/ui/cocoa/profiles/avatar_icon_controller.mm

Issue 234583008: Revert 263262 "Newly created profiles should have the grey silho..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 [cell accessibilitySetOverrideValue: 92 [cell accessibilitySetOverrideValue:
93 l10n_util::GetNSString(IDS_PROFILES_BUBBLE_ACCESSIBLE_DESCRIPTION) 93 l10n_util::GetNSString(IDS_PROFILES_BUBBLE_ACCESSIBLE_DESCRIPTION)
94 forAttribute:NSAccessibilityHelpAttribute]; 94 forAttribute:NSAccessibilityHelpAttribute];
95 [cell accessibilitySetOverrideValue: 95 [cell accessibilitySetOverrideValue:
96 l10n_util::GetNSString(IDS_PROFILES_BUBBLE_ACCESSIBLE_DESCRIPTION) 96 l10n_util::GetNSString(IDS_PROFILES_BUBBLE_ACCESSIBLE_DESCRIPTION)
97 forAttribute:NSAccessibilityDescriptionAttribute]; 97 forAttribute:NSAccessibilityDescriptionAttribute];
98 98
99 Profile* profile = browser_->profile(); 99 Profile* profile = browser_->profile();
100 100
101 if (profile->IsOffTheRecord() || profile->IsGuestSession()) { 101 if (profile->IsOffTheRecord() || profile->IsGuestSession()) {
102 const int icon_id = profile->IsGuestSession() ? 102 const int icon_id = profile->IsGuestSession() ? IDR_LOGIN_GUEST :
103 profiles::GetPlaceholderAvatarIconResourceID() : IDR_OTR_ICON; 103 IDR_OTR_ICON;
104 NSImage* icon = ResourceBundle::GetSharedInstance().GetNativeImageNamed( 104 NSImage* icon = ResourceBundle::GetSharedInstance().GetNativeImageNamed(
105 icon_id).ToNSImage(); 105 icon_id).ToNSImage();
106 [self setImage:[self compositeImageWithShadow:icon]]; 106 [self setImage:[self compositeImageWithShadow:icon]];
107 [self setButtonEnabled:profile->IsGuestSession()]; 107 [self setButtonEnabled:profile->IsGuestSession()];
108 } else { 108 } else {
109 [self setButtonEnabled:YES]; 109 [self setButtonEnabled:YES];
110 [self updateAvatarButtonAndLayoutParent:NO]; 110 [self updateAvatarButtonAndLayoutParent:NO];
111 111
112 // Managed users cannot enter incognito mode, so we only need to check 112 // Managed users cannot enter incognito mode, so we only need to check
113 // it in this code path. 113 // it in this code path.
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 // needs to be adjusted. Since the fullscreen button is positioned by 232 // needs to be adjusted. Since the fullscreen button is positioned by
233 // FramedBrowserWindow using private APIs, the easiest way to update the 233 // FramedBrowserWindow using private APIs, the easiest way to update the
234 // position of the button is through this private API. Resizing the window 234 // position of the button is through this private API. Resizing the window
235 // also works, but invoking |-display| does not. 235 // also works, but invoking |-display| does not.
236 NSView* themeFrame = [[[wc window] contentView] superview]; 236 NSView* themeFrame = [[[wc window] contentView] superview];
237 if ([themeFrame respondsToSelector:@selector(_tileTitlebarAndRedisplay:)]) 237 if ([themeFrame respondsToSelector:@selector(_tileTitlebarAndRedisplay:)])
238 [themeFrame _tileTitlebarAndRedisplay:YES]; 238 [themeFrame _tileTitlebarAndRedisplay:YES];
239 } 239 }
240 240
241 @end 241 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698