| 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_CHROMEOS_LOGIN_GAIA_SCREEN_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_GAIA_SCREEN_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_GAIA_SCREEN_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_GAIA_SCREEN_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h" | 13 #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h" |
| 14 #include "chrome/browser/extensions/signin/scoped_gaia_auth_extension.h" | 14 #include "chrome/browser/extensions/signin/scoped_gaia_auth_extension.h" |
| 15 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" | 15 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" |
| 16 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" | 16 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" |
| 17 #include "net/base/net_errors.h" | 17 #include "net/base/net_errors.h" |
| 18 | 18 |
| 19 namespace policy { | 19 namespace policy { |
| 20 class ConsumerManagementService; | 20 class ConsumerManagementService; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace user_manager { |
| 24 class UserID; |
| 25 } |
| 26 |
| 23 namespace chromeos { | 27 namespace chromeos { |
| 24 | 28 |
| 25 class SigninScreenHandler; | 29 class SigninScreenHandler; |
| 26 class SigninScreenHandlerDelegate; | 30 class SigninScreenHandlerDelegate; |
| 27 | 31 |
| 28 // A class that's used to specify the way how Gaia should be loaded. | 32 // A class that's used to specify the way how Gaia should be loaded. |
| 29 struct GaiaContext { | 33 struct GaiaContext { |
| 30 GaiaContext(); | 34 GaiaContext(); |
| 31 | 35 |
| 32 // Forces Gaia to reload. | 36 // Forces Gaia to reload. |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 bool using_saml, | 143 bool using_saml, |
| 140 bool success); | 144 bool success); |
| 141 | 145 |
| 142 // Really handles the complete login message. | 146 // Really handles the complete login message. |
| 143 void DoCompleteLogin(const std::string& gaia_id, | 147 void DoCompleteLogin(const std::string& gaia_id, |
| 144 const std::string& typed_email, | 148 const std::string& typed_email, |
| 145 const std::string& password, | 149 const std::string& password, |
| 146 bool using_saml); | 150 bool using_saml); |
| 147 | 151 |
| 148 // Fill GAIA user name. | 152 // Fill GAIA user name. |
| 149 void PopulateEmail(const std::string& user_id); | 153 void PopulateEmail(const std::string& email); |
| 150 | 154 |
| 151 // Mark user as having password changed: | 155 // Mark user as having password changed: |
| 152 void PasswordChangedFor(const std::string& user_id); | 156 void PasswordChangedFor(const user_manager::UserID& user_id); |
| 153 | 157 |
| 154 // Kick off cookie / local storage cleanup. | 158 // Kick off cookie / local storage cleanup. |
| 155 void StartClearingCookies(const base::Closure& on_clear_callback); | 159 void StartClearingCookies(const base::Closure& on_clear_callback); |
| 156 void OnCookiesCleared(const base::Closure& on_clear_callback); | 160 void OnCookiesCleared(const base::Closure& on_clear_callback); |
| 157 | 161 |
| 158 // Kick off DNS cache flushing. | 162 // Kick off DNS cache flushing. |
| 159 void StartClearingDnsCache(); | 163 void StartClearingDnsCache(); |
| 160 void OnDnsCleared(); | 164 void OnDnsCleared(); |
| 161 | 165 |
| 162 // Show sign-in screen for the given credentials. | 166 // Show sign-in screen for the given credentials. |
| 163 virtual void ShowSigninScreenForCreds(const std::string& username, | 167 virtual void ShowSigninScreenForCreds(const user_manager::UserID& user_id, |
| 164 const std::string& password); | 168 const std::string& password); |
| 165 // Attempts login for test. | 169 // Attempts login for test. |
| 166 void SubmitLoginFormForTest(); | 170 void SubmitLoginFormForTest(); |
| 167 | 171 |
| 168 // Updates the member variable and UMA histogram indicating whether the | 172 // Updates the member variable and UMA histogram indicating whether the |
| 169 // principals API was used during SAML login. | 173 // principals API was used during SAML login. |
| 170 void SetSAMLPrincipalsAPIUsed(bool api_used); | 174 void SetSAMLPrincipalsAPIUsed(bool api_used); |
| 171 | 175 |
| 172 // Show the sign-in screen. Depending on internal state, the screen will | 176 // Show the sign-in screen. Depending on internal state, the screen will |
| 173 // either be shown immediately or after an asynchronous clean-up process that | 177 // either be shown immediately or after an asynchronous clean-up process that |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 | 217 |
| 214 // Consumer management service for checking if enrollment is in progress. | 218 // Consumer management service for checking if enrollment is in progress. |
| 215 policy::ConsumerManagementService* consumer_management_; | 219 policy::ConsumerManagementService* consumer_management_; |
| 216 | 220 |
| 217 CoreOobeActor* core_oobe_actor_; | 221 CoreOobeActor* core_oobe_actor_; |
| 218 | 222 |
| 219 // Email to pre-populate with. | 223 // Email to pre-populate with. |
| 220 std::string populated_email_; | 224 std::string populated_email_; |
| 221 | 225 |
| 222 // Emails of the users, whose passwords have recently been changed. | 226 // Emails of the users, whose passwords have recently been changed. |
| 223 std::set<std::string> password_changed_for_; | 227 std::set<user_manager::UserID> password_changed_for_; |
| 224 | 228 |
| 225 // True if dns cache cleanup is done. | 229 // True if dns cache cleanup is done. |
| 226 bool dns_cleared_; | 230 bool dns_cleared_; |
| 227 | 231 |
| 228 // True if DNS cache task is already running. | 232 // True if DNS cache task is already running. |
| 229 bool dns_clear_task_running_; | 233 bool dns_clear_task_running_; |
| 230 | 234 |
| 231 // True if cookie jar cleanup is done. | 235 // True if cookie jar cleanup is done. |
| 232 bool cookies_cleared_; | 236 bool cookies_cleared_; |
| 233 | 237 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 scoped_ptr<ScopedGaiaAuthExtension> auth_extension_; | 273 scoped_ptr<ScopedGaiaAuthExtension> auth_extension_; |
| 270 | 274 |
| 271 base::WeakPtrFactory<GaiaScreenHandler> weak_factory_; | 275 base::WeakPtrFactory<GaiaScreenHandler> weak_factory_; |
| 272 | 276 |
| 273 DISALLOW_COPY_AND_ASSIGN(GaiaScreenHandler); | 277 DISALLOW_COPY_AND_ASSIGN(GaiaScreenHandler); |
| 274 }; | 278 }; |
| 275 | 279 |
| 276 } // namespace chromeos | 280 } // namespace chromeos |
| 277 | 281 |
| 278 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_GAIA_SCREEN_HANDLER_H_ | 282 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_GAIA_SCREEN_HANDLER_H_ |
| OLD | NEW |