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 <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 1704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1715 kBlueButtonHeight + kSmallVerticalSpacing); | 1715 kBlueButtonHeight + kSmallVerticalSpacing); |
1716 base::scoped_nsobject<NSView> container([[NSView alloc] initWithFrame:rect]); | 1716 base::scoped_nsobject<NSView> container([[NSView alloc] initWithFrame:rect]); |
1717 | 1717 |
1718 if (displayLock) { | 1718 if (displayLock) { |
1719 NSButton* lockButton = | 1719 NSButton* lockButton = |
1720 [self hoverButtonWithRect:viewRect | 1720 [self hoverButtonWithRect:viewRect |
1721 text:l10n_util::GetNSString( | 1721 text:l10n_util::GetNSString( |
1722 IDS_PROFILES_PROFILE_SIGNOUT_BUTTON) | 1722 IDS_PROFILES_PROFILE_SIGNOUT_BUTTON) |
1723 imageResourceId:IDR_ICON_PROFILES_MENU_LOCK | 1723 imageResourceId:IDR_ICON_PROFILES_MENU_LOCK |
1724 action:@selector(lockProfile:)]; | 1724 action:@selector(lockProfile:)]; |
1725 | |
1726 if (!browser_->profile()->GetPrefs()->GetBoolean( | |
1727 prefs::kProfileIsLockable)) { | |
noms (inactive)
2014/09/12 19:33:26
I don't think we should display the button at all
Mike Lerman
2014/09/15 14:08:56
Chatted on one bug or another (I can find it if yo
| |
1728 [lockButton setEnabled:NO]; | |
1729 } | |
1725 [container addSubview:lockButton]; | 1730 [container addSubview:lockButton]; |
1726 viewRect.origin.y = NSMaxY([lockButton frame]); | 1731 viewRect.origin.y = NSMaxY([lockButton frame]); |
1727 | 1732 |
1728 NSBox* separator = [self horizontalSeparatorWithFrame:viewRect]; | 1733 NSBox* separator = [self horizontalSeparatorWithFrame:viewRect]; |
1729 [container addSubview:separator]; | 1734 [container addSubview:separator]; |
1730 viewRect.origin.y = NSMaxY([separator frame]); | 1735 viewRect.origin.y = NSMaxY([separator frame]); |
1731 } | 1736 } |
1732 | 1737 |
1733 if ([self shouldShowGoIncognito]) { | 1738 if ([self shouldShowGoIncognito]) { |
1734 NSButton* goIncognitoButton = | 1739 NSButton* goIncognitoButton = |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2177 } | 2182 } |
2178 | 2183 |
2179 - (bool)shouldShowGoIncognito { | 2184 - (bool)shouldShowGoIncognito { |
2180 bool incognitoAvailable = | 2185 bool incognitoAvailable = |
2181 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 2186 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
2182 IncognitoModePrefs::DISABLED; | 2187 IncognitoModePrefs::DISABLED; |
2183 return incognitoAvailable && !browser_->profile()->IsGuestSession(); | 2188 return incognitoAvailable && !browser_->profile()->IsGuestSession(); |
2184 } | 2189 } |
2185 | 2190 |
2186 @end | 2191 @end |
OLD | NEW |