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 #import <Carbon/Carbon.h> // kVK_Return. | 6 #import <Carbon/Carbon.h> // kVK_Return. |
7 | 7 |
8 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h" | 8 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h" |
9 | 9 |
10 #include "base/mac/bundle_locations.h" | 10 #include "base/mac/bundle_locations.h" |
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 | 953 |
954 - (void)setTutorialMode:(profiles::TutorialMode)tutorialMode { | 954 - (void)setTutorialMode:(profiles::TutorialMode)tutorialMode { |
955 tutorialMode_ = tutorialMode; | 955 tutorialMode_ = tutorialMode; |
956 } | 956 } |
957 | 957 |
958 - (IBAction)switchToProfile:(id)sender { | 958 - (IBAction)switchToProfile:(id)sender { |
959 // Check the event flags to see if a new window should be created. | 959 // Check the event flags to see if a new window should be created. |
960 bool alwaysCreate = ui::WindowOpenDispositionFromNSEvent( | 960 bool alwaysCreate = ui::WindowOpenDispositionFromNSEvent( |
961 [NSApp currentEvent]) == NEW_WINDOW; | 961 [NSApp currentEvent]) == NEW_WINDOW; |
962 avatarMenu_->SwitchToProfile([sender tag], alwaysCreate, | 962 avatarMenu_->SwitchToProfile([sender tag], alwaysCreate, |
963 ProfileMetrics::SWITCH_PROFILE_ICON); | 963 ProfileMetrics::SWITCH_PROFILE_FAST_SWITCHER); |
964 } | 964 } |
965 | 965 |
966 - (IBAction)showUserManager:(id)sender { | 966 - (IBAction)showUserManager:(id)sender { |
967 UserManager::Show(base::FilePath(), | 967 UserManager::Show(base::FilePath(), |
968 profiles::USER_MANAGER_NO_TUTORIAL, | 968 profiles::USER_MANAGER_NO_TUTORIAL, |
969 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); | 969 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); |
970 [self postActionPerformed: | 970 [self postActionPerformed: |
971 ProfileMetrics::PROFILE_DESKTOP_MENU_OPEN_USER_MANAGER]; | 971 ProfileMetrics::PROFILE_DESKTOP_MENU_OPEN_USER_MANAGER]; |
972 } | 972 } |
973 | 973 |
(...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2284 } | 2284 } |
2285 | 2285 |
2286 - (bool)shouldShowGoIncognito { | 2286 - (bool)shouldShowGoIncognito { |
2287 bool incognitoAvailable = | 2287 bool incognitoAvailable = |
2288 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 2288 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
2289 IncognitoModePrefs::DISABLED; | 2289 IncognitoModePrefs::DISABLED; |
2290 return incognitoAvailable && !browser_->profile()->IsGuestSession(); | 2290 return incognitoAvailable && !browser_->profile()->IsGuestSession(); |
2291 } | 2291 } |
2292 | 2292 |
2293 @end | 2293 @end |
OLD | NEW |