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 if (!chrome::LocalAuthCredentialsExist(browser_->profile())) | |
1726 [lockButton setEnabled:NO]; | |
1727 [container addSubview:lockButton]; | 1725 [container addSubview:lockButton]; |
1728 viewRect.origin.y = NSMaxY([lockButton frame]); | 1726 viewRect.origin.y = NSMaxY([lockButton frame]); |
1729 | 1727 |
1730 NSBox* separator = [self horizontalSeparatorWithFrame:viewRect]; | 1728 NSBox* separator = [self horizontalSeparatorWithFrame:viewRect]; |
1731 [container addSubview:separator]; | 1729 [container addSubview:separator]; |
1732 viewRect.origin.y = NSMaxY([separator frame]); | 1730 viewRect.origin.y = NSMaxY([separator frame]); |
1733 } | 1731 } |
1734 | 1732 |
1735 if ([self shouldShowGoIncognito]) { | 1733 if ([self shouldShowGoIncognito]) { |
1736 NSButton* goIncognitoButton = | 1734 NSButton* goIncognitoButton = |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2179 } | 2177 } |
2180 | 2178 |
2181 - (bool)shouldShowGoIncognito { | 2179 - (bool)shouldShowGoIncognito { |
2182 bool incognitoAvailable = | 2180 bool incognitoAvailable = |
2183 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 2181 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
2184 IncognitoModePrefs::DISABLED; | 2182 IncognitoModePrefs::DISABLED; |
2185 return incognitoAvailable && !browser_->profile()->IsGuestSession(); | 2183 return incognitoAvailable && !browser_->profile()->IsGuestSession(); |
2186 } | 2184 } |
2187 | 2185 |
2188 @end | 2186 @end |
OLD | NEW |