| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_UI_WEBUI_SIGNIN_USER_MANAGER_SCREEN_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SIGNIN_USER_MANAGER_SCREEN_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_SIGNIN_USER_MANAGER_SCREEN_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SIGNIN_USER_MANAGER_SCREEN_HANDLER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> |
| 9 #include <string> | 10 #include <string> |
| 10 | 11 |
| 11 #include "base/callback.h" | 12 #include "base/callback.h" |
| 12 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/task/cancelable_task_tracker.h" | 16 #include "base/task/cancelable_task_tracker.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/profiles/profile_metrics.h" | 18 #include "chrome/browser/profiles/profile_metrics.h" |
| 19 #include "chrome/browser/profiles/profile_statistics.h" | 19 #include "chrome/browser/profiles/profile_statistics.h" |
| 20 #include "components/proximity_auth/screenlock_bridge.h" | 20 #include "components/proximity_auth/screenlock_bridge.h" |
| 21 #include "content/public/browser/notification_observer.h" | 21 #include "content/public/browser/notification_observer.h" |
| 22 #include "content/public/browser/notification_registrar.h" | 22 #include "content/public/browser/notification_registrar.h" |
| 23 #include "content/public/browser/web_ui_message_handler.h" | 23 #include "content/public/browser/web_ui_message_handler.h" |
| 24 #include "google_apis/gaia/gaia_oauth_client.h" | 24 #include "google_apis/gaia/gaia_oauth_client.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 void HandleRemoveUserWarningLoadStats(const base::ListValue* args); | 87 void HandleRemoveUserWarningLoadStats(const base::ListValue* args); |
| 88 void HandleGetRemoveWarningDialogMessage(const base::ListValue* args); | 88 void HandleGetRemoveWarningDialogMessage(const base::ListValue* args); |
| 89 | 89 |
| 90 // Callback function used by HandleRemoveUserWarningLoadStats | 90 // Callback function used by HandleRemoveUserWarningLoadStats |
| 91 void RemoveUserDialogLoadStatsCallback( | 91 void RemoveUserDialogLoadStatsCallback( |
| 92 base::FilePath profile_path, | 92 base::FilePath profile_path, |
| 93 profiles::ProfileCategoryStats result); | 93 profiles::ProfileCategoryStats result); |
| 94 | 94 |
| 95 // Handle GAIA auth results. | 95 // Handle GAIA auth results. |
| 96 void OnGetTokenInfoResponse( | 96 void OnGetTokenInfoResponse( |
| 97 scoped_ptr<base::DictionaryValue> token_info) override; | 97 std::unique_ptr<base::DictionaryValue> token_info) override; |
| 98 void OnOAuthError() override; | 98 void OnOAuthError() override; |
| 99 void OnNetworkError(int response_code) override; | 99 void OnNetworkError(int response_code) override; |
| 100 | 100 |
| 101 // Handle when Notified of a NOTIFICATION_BROWSER_WINDOW_READY event. | 101 // Handle when Notified of a NOTIFICATION_BROWSER_WINDOW_READY event. |
| 102 void OnBrowserWindowReady(Browser* browser); | 102 void OnBrowserWindowReady(Browser* browser); |
| 103 | 103 |
| 104 // Sends user list to account chooser. | 104 // Sends user list to account chooser. |
| 105 void SendUserList(); | 105 void SendUserList(); |
| 106 | 106 |
| 107 // Pass success/failure information back to the web page. | 107 // Pass success/failure information back to the web page. |
| 108 void ReportAuthenticationResult(bool success, | 108 void ReportAuthenticationResult(bool success, |
| 109 ProfileMetrics::ProfileAuth metric); | 109 ProfileMetrics::ProfileAuth metric); |
| 110 | 110 |
| 111 // Perform cleanup once the profile and browser are open. | 111 // Perform cleanup once the profile and browser are open. |
| 112 void OnSwitchToProfileComplete(Profile* profile, | 112 void OnSwitchToProfileComplete(Profile* profile, |
| 113 Profile::CreateStatus profile_create_status); | 113 Profile::CreateStatus profile_create_status); |
| 114 | 114 |
| 115 // Observes the ProfileAttributesStorage and gets notified when a profile has | 115 // Observes the ProfileAttributesStorage and gets notified when a profile has |
| 116 // been modified, so that the displayed user pods can be updated. | 116 // been modified, so that the displayed user pods can be updated. |
| 117 scoped_ptr<ProfileUpdateObserver> profile_attributes_storage_observer_; | 117 std::unique_ptr<ProfileUpdateObserver> profile_attributes_storage_observer_; |
| 118 | 118 |
| 119 // Authenticator used when local-auth fails. | 119 // Authenticator used when local-auth fails. |
| 120 scoped_ptr<gaia::GaiaOAuthClient> oauth_client_; | 120 std::unique_ptr<gaia::GaiaOAuthClient> oauth_client_; |
| 121 | 121 |
| 122 // The path of the profile currently being authenticated. | 122 // The path of the profile currently being authenticated. |
| 123 base::FilePath authenticating_profile_path_; | 123 base::FilePath authenticating_profile_path_; |
| 124 | 124 |
| 125 // Login email held during on-line auth for later use. | 125 // Login email held during on-line auth for later use. |
| 126 std::string email_address_; | 126 std::string email_address_; |
| 127 | 127 |
| 128 // URL hash, used to key post-profile actions if present. | 128 // URL hash, used to key post-profile actions if present. |
| 129 std::string url_hash_; | 129 std::string url_hash_; |
| 130 | 130 |
| 131 typedef std::map<std::string, | 131 typedef std::map<std::string, |
| 132 proximity_auth::ScreenlockBridge::LockHandler::AuthType> | 132 proximity_auth::ScreenlockBridge::LockHandler::AuthType> |
| 133 UserAuthTypeMap; | 133 UserAuthTypeMap; |
| 134 UserAuthTypeMap user_auth_type_map_; | 134 UserAuthTypeMap user_auth_type_map_; |
| 135 | 135 |
| 136 content::NotificationRegistrar registrar_; | 136 content::NotificationRegistrar registrar_; |
| 137 | 137 |
| 138 // The CancelableTaskTracker is currently used by GetProfileStatistics | 138 // The CancelableTaskTracker is currently used by GetProfileStatistics |
| 139 base::CancelableTaskTracker tracker_; | 139 base::CancelableTaskTracker tracker_; |
| 140 | 140 |
| 141 base::WeakPtrFactory<UserManagerScreenHandler> weak_ptr_factory_; | 141 base::WeakPtrFactory<UserManagerScreenHandler> weak_ptr_factory_; |
| 142 | 142 |
| 143 DISALLOW_COPY_AND_ASSIGN(UserManagerScreenHandler); | 143 DISALLOW_COPY_AND_ASSIGN(UserManagerScreenHandler); |
| 144 }; | 144 }; |
| 145 | 145 |
| 146 #endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_USER_MANAGER_SCREEN_HANDLER_H_ | 146 #endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_USER_MANAGER_SCREEN_HANDLER_H_ |
| OLD | NEW |