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

Side by Side Diff: chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm

Issue 566933005: Do not display lock for hosted domains (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Hide rather than disable lock for hd users Created 6 years, 3 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
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 <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h" 7 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h"
8 8
9 #include "base/mac/bundle_locations.h" 9 #include "base/mac/bundle_locations.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1172 [self buildWelcomeUpgradeTutorialViewIfNeeded]; 1172 [self buildWelcomeUpgradeTutorialViewIfNeeded];
1173 break; 1173 break;
1174 case profiles::TUTORIAL_MODE_CONFIRM_SIGNIN: 1174 case profiles::TUTORIAL_MODE_CONFIRM_SIGNIN:
1175 tutorialView = [self buildSigninConfirmationView]; 1175 tutorialView = [self buildSigninConfirmationView];
1176 break; 1176 break;
1177 case profiles::TUTORIAL_MODE_SHOW_ERROR: 1177 case profiles::TUTORIAL_MODE_SHOW_ERROR:
1178 tutorialView = [self buildSigninErrorView]; 1178 tutorialView = [self buildSigninErrorView];
1179 } 1179 }
1180 } 1180 }
1181 currentProfileView = [self createCurrentProfileView:item]; 1181 currentProfileView = [self createCurrentProfileView:item];
1182 displayLock = switches::IsNewProfileManagement() && item.signed_in; 1182 displayLock = switches::IsNewProfileManagement() && item.signed_in &&
1183 browser_->profile()->GetPrefs()->GetBoolean(
noms (inactive) 2014/09/17 19:12:05 nit: can think this can all fit in one line, if yo
Mike Lerman 2014/09/17 19:45:36 I wish, but I'm one character over.
1184 prefs::kProfileIsLockable);
1183 } else { 1185 } else {
1184 [otherProfiles addObject:[self createOtherProfileView:i]]; 1186 [otherProfiles addObject:[self createOtherProfileView:i]];
1185 } 1187 }
1186 } 1188 }
1187 if (!currentProfileView) // Guest windows don't have an active profile. 1189 if (!currentProfileView) // Guest windows don't have an active profile.
1188 currentProfileView = [self createGuestProfileView]; 1190 currentProfileView = [self createGuestProfileView];
1189 1191
1190 // |yOffset| is the next position at which to draw in |container| 1192 // |yOffset| is the next position at which to draw in |container|
1191 // coordinates. Add a pixel offset so that the bottom option buttons don't 1193 // coordinates. Add a pixel offset so that the bottom option buttons don't
1192 // overlap the bubble's rounded corners. 1194 // overlap the bubble's rounded corners.
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
1715 kBlueButtonHeight + kSmallVerticalSpacing); 1717 kBlueButtonHeight + kSmallVerticalSpacing);
1716 base::scoped_nsobject<NSView> container([[NSView alloc] initWithFrame:rect]); 1718 base::scoped_nsobject<NSView> container([[NSView alloc] initWithFrame:rect]);
1717 1719
1718 if (displayLock) { 1720 if (displayLock) {
1719 NSButton* lockButton = 1721 NSButton* lockButton =
1720 [self hoverButtonWithRect:viewRect 1722 [self hoverButtonWithRect:viewRect
1721 text:l10n_util::GetNSString( 1723 text:l10n_util::GetNSString(
1722 IDS_PROFILES_PROFILE_SIGNOUT_BUTTON) 1724 IDS_PROFILES_PROFILE_SIGNOUT_BUTTON)
1723 imageResourceId:IDR_ICON_PROFILES_MENU_LOCK 1725 imageResourceId:IDR_ICON_PROFILES_MENU_LOCK
1724 action:@selector(lockProfile:)]; 1726 action:@selector(lockProfile:)];
1727
1728 if (!browser_->profile()->GetPrefs()->GetBoolean(
1729 prefs::kProfileIsLockable)) {
noms (inactive) 2014/09/17 19:12:05 nit: this should only be indented by 4
Mike Lerman 2014/09/17 19:45:36 Done.
1730 [lockButton setEnabled:NO];
1731 }
1725 [container addSubview:lockButton]; 1732 [container addSubview:lockButton];
1726 viewRect.origin.y = NSMaxY([lockButton frame]); 1733 viewRect.origin.y = NSMaxY([lockButton frame]);
1727 1734
1728 NSBox* separator = [self horizontalSeparatorWithFrame:viewRect]; 1735 NSBox* separator = [self horizontalSeparatorWithFrame:viewRect];
1729 [container addSubview:separator]; 1736 [container addSubview:separator];
1730 viewRect.origin.y = NSMaxY([separator frame]); 1737 viewRect.origin.y = NSMaxY([separator frame]);
1731 } 1738 }
1732 1739
1733 if ([self shouldShowGoIncognito]) { 1740 if ([self shouldShowGoIncognito]) {
1734 NSButton* goIncognitoButton = 1741 NSButton* goIncognitoButton =
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
2177 } 2184 }
2178 2185
2179 - (bool)shouldShowGoIncognito { 2186 - (bool)shouldShowGoIncognito {
2180 bool incognitoAvailable = 2187 bool incognitoAvailable =
2181 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != 2188 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) !=
2182 IncognitoModePrefs::DISABLED; 2189 IncognitoModePrefs::DISABLED;
2183 return incognitoAvailable && !browser_->profile()->IsGuestSession(); 2190 return incognitoAvailable && !browser_->profile()->IsGuestSession();
2184 } 2191 }
2185 2192
2186 @end 2193 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698