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

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

Issue 1143323005: Refactor AO2TS to make it easier to componentize. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: works for all platforms commit e75a498951318d4deb65d40ce8b2def44cd5abc0 Created 5 years, 6 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 "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h" 5 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h"
6 6
7 #import <Carbon/Carbon.h> // kVK_Return. 7 #import <Carbon/Carbon.h> // kVK_Return.
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 #include "base/mac/bundle_locations.h" 10 #include "base/mac/bundle_locations.h"
(...skipping 30 matching lines...) Expand all
41 #import "chrome/browser/ui/cocoa/info_bubble_window.h" 41 #import "chrome/browser/ui/cocoa/info_bubble_window.h"
42 #import "chrome/browser/ui/cocoa/profiles/user_manager_mac.h" 42 #import "chrome/browser/ui/cocoa/profiles/user_manager_mac.h"
43 #include "chrome/browser/ui/singleton_tabs.h" 43 #include "chrome/browser/ui/singleton_tabs.h"
44 #include "chrome/browser/ui/user_manager.h" 44 #include "chrome/browser/ui/user_manager.h"
45 #include "chrome/browser/ui/webui/signin/login_ui_service.h" 45 #include "chrome/browser/ui/webui/signin/login_ui_service.h"
46 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" 46 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
47 #include "chrome/common/pref_names.h" 47 #include "chrome/common/pref_names.h"
48 #include "chrome/common/url_constants.h" 48 #include "chrome/common/url_constants.h"
49 #include "chrome/grit/chromium_strings.h" 49 #include "chrome/grit/chromium_strings.h"
50 #include "chrome/grit/generated_resources.h" 50 #include "chrome/grit/generated_resources.h"
51 #include "components/signin/core/browser/mutable_profile_oauth2_token_service.h"
52 #include "components/signin/core/browser/profile_oauth2_token_service.h" 51 #include "components/signin/core/browser/profile_oauth2_token_service.h"
53 #include "components/signin/core/browser/signin_manager.h" 52 #include "components/signin/core/browser/signin_manager.h"
54 #include "components/signin/core/common/profile_management_switches.h" 53 #include "components/signin/core/common/profile_management_switches.h"
55 #include "content/public/browser/native_web_keyboard_event.h" 54 #include "content/public/browser/native_web_keyboard_event.h"
56 #include "content/public/browser/notification_service.h" 55 #include "content/public/browser/notification_service.h"
57 #include "content/public/browser/render_widget_host_view.h" 56 #include "content/public/browser/render_widget_host_view.h"
58 #include "content/public/browser/web_contents.h" 57 #include "content/public/browser/web_contents.h"
59 #include "google_apis/gaia/oauth2_token_service.h" 58 #include "google_apis/gaia/oauth2_token_service.h"
60 #include "grit/theme_resources.h" 59 #include "grit/theme_resources.h"
61 #include "skia/ext/skia_utils_mac.h" 60 #include "skia/ext/skia_utils_mac.h"
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 [self initMenuContentsWithView:profiles::BUBBLE_VIEW_MODE_ACCOUNT_REMOVAL]; 1081 [self initMenuContentsWithView:profiles::BUBBLE_VIEW_MODE_ACCOUNT_REMOVAL];
1083 } 1082 }
1084 1083
1085 - (IBAction)showAccountReauthenticationView:(id)sender { 1084 - (IBAction)showAccountReauthenticationView:(id)sender {
1086 DCHECK(!isGuestSession_); 1085 DCHECK(!isGuestSession_);
1087 [self initMenuContentsWithView:profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH]; 1086 [self initMenuContentsWithView:profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH];
1088 } 1087 }
1089 1088
1090 - (IBAction)removeAccount:(id)sender { 1089 - (IBAction)removeAccount:(id)sender {
1091 DCHECK(!accountIdToRemove_.empty()); 1090 DCHECK(!accountIdToRemove_.empty());
1092 ProfileOAuth2TokenServiceFactory::GetPlatformSpecificForProfile( 1091 ProfileOAuth2TokenServiceFactory::GetForProfile(browser_->profile())
1093 browser_->profile())->RevokeCredentials(accountIdToRemove_); 1092 ->RevokeCredentials(accountIdToRemove_);
1094 [self postActionPerformed:ProfileMetrics::PROFILE_DESKTOP_MENU_REMOVE_ACCT]; 1093 [self postActionPerformed:ProfileMetrics::PROFILE_DESKTOP_MENU_REMOVE_ACCT];
1095 accountIdToRemove_.clear(); 1094 accountIdToRemove_.clear();
1096 1095
1097 [self initMenuContentsWithView:profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT]; 1096 [self initMenuContentsWithView:profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT];
1098 } 1097 }
1099 1098
1100 - (IBAction)seeWhatsNew:(id)sender { 1099 - (IBAction)seeWhatsNew:(id)sender {
1101 UserManager::Show(base::FilePath(), 1100 UserManager::Show(base::FilePath(),
1102 profiles::USER_MANAGER_TUTORIAL_OVERVIEW, 1101 profiles::USER_MANAGER_TUTORIAL_OVERVIEW,
1103 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); 1102 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION);
(...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after
2400 } 2399 }
2401 2400
2402 - (bool)shouldShowGoIncognito { 2401 - (bool)shouldShowGoIncognito {
2403 bool incognitoAvailable = 2402 bool incognitoAvailable =
2404 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != 2403 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) !=
2405 IncognitoModePrefs::DISABLED; 2404 IncognitoModePrefs::DISABLED;
2406 return incognitoAvailable && !browser_->profile()->IsGuestSession(); 2405 return incognitoAvailable && !browser_->profile()->IsGuestSession();
2407 } 2406 }
2408 2407
2409 @end 2408 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698