| 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 12 matching lines...) Expand all Loading... |
| 23 #include "chrome/browser/profiles/profile_window.h" | 23 #include "chrome/browser/profiles/profile_window.h" |
| 24 #include "chrome/browser/profiles/profiles_state.h" | 24 #include "chrome/browser/profiles/profiles_state.h" |
| 25 #include "chrome/browser/signin/local_auth.h" | 25 #include "chrome/browser/signin/local_auth.h" |
| 26 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 26 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
| 27 #include "chrome/browser/signin/signin_header_helper.h" | 27 #include "chrome/browser/signin/signin_header_helper.h" |
| 28 #include "chrome/browser/signin/signin_manager_factory.h" | 28 #include "chrome/browser/signin/signin_manager_factory.h" |
| 29 #include "chrome/browser/signin/signin_promo.h" | 29 #include "chrome/browser/signin/signin_promo.h" |
| 30 #include "chrome/browser/signin/signin_ui_util.h" | 30 #include "chrome/browser/signin/signin_ui_util.h" |
| 31 #include "chrome/browser/ui/browser.h" | 31 #include "chrome/browser/ui/browser.h" |
| 32 #include "chrome/browser/ui/browser_commands.h" | 32 #include "chrome/browser/ui/browser_commands.h" |
| 33 #include "chrome/browser/ui/browser_dialogs.h" | |
| 34 #include "chrome/browser/ui/browser_window.h" | 33 #include "chrome/browser/ui/browser_window.h" |
| 35 #include "chrome/browser/ui/chrome_pages.h" | 34 #include "chrome/browser/ui/chrome_pages.h" |
| 36 #include "chrome/browser/ui/chrome_style.h" | 35 #include "chrome/browser/ui/chrome_style.h" |
| 36 #include "chrome/browser/ui/user_manager.h" |
| 37 #import "chrome/browser/ui/cocoa/hyperlink_text_view.h" | 37 #import "chrome/browser/ui/cocoa/hyperlink_text_view.h" |
| 38 #import "chrome/browser/ui/cocoa/info_bubble_view.h" | 38 #import "chrome/browser/ui/cocoa/info_bubble_view.h" |
| 39 #import "chrome/browser/ui/cocoa/info_bubble_window.h" | 39 #import "chrome/browser/ui/cocoa/info_bubble_window.h" |
| 40 #import "chrome/browser/ui/cocoa/profiles/user_manager_mac.h" | 40 #import "chrome/browser/ui/cocoa/profiles/user_manager_mac.h" |
| 41 #include "chrome/browser/ui/singleton_tabs.h" | 41 #include "chrome/browser/ui/singleton_tabs.h" |
| 42 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 42 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
| 43 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 43 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
| 44 #include "chrome/common/pref_names.h" | 44 #include "chrome/common/pref_names.h" |
| 45 #include "chrome/common/url_constants.h" | 45 #include "chrome/common/url_constants.h" |
| 46 #include "chrome/grit/chromium_strings.h" | 46 #include "chrome/grit/chromium_strings.h" |
| (...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 888 | 888 |
| 889 - (IBAction)switchToProfile:(id)sender { | 889 - (IBAction)switchToProfile:(id)sender { |
| 890 // Check the event flags to see if a new window should be created. | 890 // Check the event flags to see if a new window should be created. |
| 891 bool alwaysCreate = ui::WindowOpenDispositionFromNSEvent( | 891 bool alwaysCreate = ui::WindowOpenDispositionFromNSEvent( |
| 892 [NSApp currentEvent]) == NEW_WINDOW; | 892 [NSApp currentEvent]) == NEW_WINDOW; |
| 893 avatarMenu_->SwitchToProfile([sender tag], alwaysCreate, | 893 avatarMenu_->SwitchToProfile([sender tag], alwaysCreate, |
| 894 ProfileMetrics::SWITCH_PROFILE_ICON); | 894 ProfileMetrics::SWITCH_PROFILE_ICON); |
| 895 } | 895 } |
| 896 | 896 |
| 897 - (IBAction)showUserManager:(id)sender { | 897 - (IBAction)showUserManager:(id)sender { |
| 898 chrome::ShowUserManager(base::FilePath()); | 898 UserManager::Show(base::FilePath(), |
| 899 profiles::USER_MANAGER_NO_TUTORIAL, |
| 900 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); |
| 899 [self postActionPerformed: | 901 [self postActionPerformed: |
| 900 ProfileMetrics::PROFILE_DESKTOP_MENU_OPEN_USER_MANAGER]; | 902 ProfileMetrics::PROFILE_DESKTOP_MENU_OPEN_USER_MANAGER]; |
| 901 } | 903 } |
| 902 | 904 |
| 903 - (IBAction)exitGuest:(id)sender { | 905 - (IBAction)exitGuest:(id)sender { |
| 904 DCHECK(browser_->profile()->IsGuestSession()); | 906 DCHECK(browser_->profile()->IsGuestSession()); |
| 905 chrome::ShowUserManager(base::FilePath()); | 907 UserManager::Show(base::FilePath(), |
| 908 profiles::USER_MANAGER_NO_TUTORIAL, |
| 909 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); |
| 906 profiles::CloseGuestProfileWindows(); | 910 profiles::CloseGuestProfileWindows(); |
| 907 } | 911 } |
| 908 | 912 |
| 909 - (IBAction)goIncognito:(id)sender { | 913 - (IBAction)goIncognito:(id)sender { |
| 910 DCHECK([self shouldShowGoIncognito]); | 914 DCHECK([self shouldShowGoIncognito]); |
| 911 chrome::NewIncognitoWindow(browser_); | 915 chrome::NewIncognitoWindow(browser_); |
| 912 } | 916 } |
| 913 | 917 |
| 914 - (IBAction)showAccountManagement:(id)sender { | 918 - (IBAction)showAccountManagement:(id)sender { |
| 915 [self initMenuContentsWithView:profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT]; | 919 [self initMenuContentsWithView:profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT]; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 969 DCHECK(!accountIdToRemove_.empty()); | 973 DCHECK(!accountIdToRemove_.empty()); |
| 970 ProfileOAuth2TokenServiceFactory::GetPlatformSpecificForProfile( | 974 ProfileOAuth2TokenServiceFactory::GetPlatformSpecificForProfile( |
| 971 browser_->profile())->RevokeCredentials(accountIdToRemove_); | 975 browser_->profile())->RevokeCredentials(accountIdToRemove_); |
| 972 [self postActionPerformed:ProfileMetrics::PROFILE_DESKTOP_MENU_REMOVE_ACCT]; | 976 [self postActionPerformed:ProfileMetrics::PROFILE_DESKTOP_MENU_REMOVE_ACCT]; |
| 973 accountIdToRemove_.clear(); | 977 accountIdToRemove_.clear(); |
| 974 | 978 |
| 975 [self initMenuContentsWithView:profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT]; | 979 [self initMenuContentsWithView:profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT]; |
| 976 } | 980 } |
| 977 | 981 |
| 978 - (IBAction)seeWhatsNew:(id)sender { | 982 - (IBAction)seeWhatsNew:(id)sender { |
| 979 chrome::ShowUserManagerWithTutorial( | 983 UserManager::Show(base::FilePath(), |
| 980 profiles::USER_MANAGER_TUTORIAL_OVERVIEW); | 984 profiles::USER_MANAGER_TUTORIAL_OVERVIEW, |
| 985 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); |
| 981 ProfileMetrics::LogProfileNewAvatarMenuUpgrade( | 986 ProfileMetrics::LogProfileNewAvatarMenuUpgrade( |
| 982 ProfileMetrics::PROFILE_AVATAR_MENU_UPGRADE_WHATS_NEW); | 987 ProfileMetrics::PROFILE_AVATAR_MENU_UPGRADE_WHATS_NEW); |
| 983 } | 988 } |
| 984 | 989 |
| 985 - (IBAction)showSwitchUserView:(id)sender { | 990 - (IBAction)showSwitchUserView:(id)sender { |
| 986 [self initMenuContentsWithView:profiles::BUBBLE_VIEW_MODE_SWITCH_USER]; | 991 [self initMenuContentsWithView:profiles::BUBBLE_VIEW_MODE_SWITCH_USER]; |
| 987 ProfileMetrics::LogProfileNewAvatarMenuUpgrade( | 992 ProfileMetrics::LogProfileNewAvatarMenuUpgrade( |
| 988 ProfileMetrics::PROFILE_AVATAR_MENU_UPGRADE_NOT_YOU); | 993 ProfileMetrics::PROFILE_AVATAR_MENU_UPGRADE_NOT_YOU); |
| 989 } | 994 } |
| 990 | 995 |
| (...skipping 1186 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 |