| 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" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 // True if user list is non-empty. | 47 // True if user list is non-empty. |
| 48 bool has_users; | 48 bool has_users; |
| 49 | 49 |
| 50 // Email of the current user. | 50 // Email of the current user. |
| 51 std::string email; | 51 std::string email; |
| 52 | 52 |
| 53 // GAIA ID of the current user. | 53 // GAIA ID of the current user. |
| 54 std::string gaia_id; | 54 std::string gaia_id; |
| 55 | 55 |
| 56 // Device Id of the current user. | |
| 57 std::string device_id; | |
| 58 | |
| 59 // Whether consumer management enrollment is in progress. | 56 // Whether consumer management enrollment is in progress. |
| 60 bool is_enrolling_consumer_management; | 57 bool is_enrolling_consumer_management; |
| 61 | |
| 62 // If user session would be ephemeral. | |
| 63 bool session_is_ephemeral; | |
| 64 }; | 58 }; |
| 65 | 59 |
| 66 // A class that handles WebUI hooks in Gaia screen. | 60 // A class that handles WebUI hooks in Gaia screen. |
| 67 class GaiaScreenHandler : public BaseScreenHandler { | 61 class GaiaScreenHandler : public BaseScreenHandler { |
| 68 public: | 62 public: |
| 69 enum FrameState { | 63 enum FrameState { |
| 70 FRAME_STATE_UNKNOWN = 0, | 64 FRAME_STATE_UNKNOWN = 0, |
| 71 FRAME_STATE_LOADING, | 65 FRAME_STATE_LOADING, |
| 72 FRAME_STATE_LOADED, | 66 FRAME_STATE_LOADED, |
| 73 FRAME_STATE_ERROR | 67 FRAME_STATE_ERROR |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // WebUIMessageHandler implementation: | 108 // WebUIMessageHandler implementation: |
| 115 void RegisterMessages() override; | 109 void RegisterMessages() override; |
| 116 | 110 |
| 117 // WebUI message handlers. | 111 // WebUI message handlers. |
| 118 void HandleFrameLoadingCompleted(int status); | 112 void HandleFrameLoadingCompleted(int status); |
| 119 void HandleWebviewLoadAborted(const std::string& error_reason_str); | 113 void HandleWebviewLoadAborted(const std::string& error_reason_str); |
| 120 void HandleCompleteAuthentication(const std::string& gaia_id, | 114 void HandleCompleteAuthentication(const std::string& gaia_id, |
| 121 const std::string& email, | 115 const std::string& email, |
| 122 const std::string& password, | 116 const std::string& password, |
| 123 const std::string& auth_code, | 117 const std::string& auth_code, |
| 124 bool using_saml, | 118 bool using_saml); |
| 125 const std::string& device_id); | |
| 126 void HandleCompleteAuthenticationAuthCodeOnly(const std::string& auth_code); | 119 void HandleCompleteAuthenticationAuthCodeOnly(const std::string& auth_code); |
| 127 void HandleCompleteLogin(const std::string& gaia_id, | 120 void HandleCompleteLogin(const std::string& gaia_id, |
| 128 const std::string& typed_email, | 121 const std::string& typed_email, |
| 129 const std::string& password, | 122 const std::string& password, |
| 130 bool using_saml); | 123 bool using_saml); |
| 131 | 124 |
| 132 void HandleUsingSAMLAPI(); | 125 void HandleUsingSAMLAPI(); |
| 133 void HandleScrapedPasswordCount(int password_count); | 126 void HandleScrapedPasswordCount(int password_count); |
| 134 void HandleScrapedPasswordVerificationFailed(); | 127 void HandleScrapedPasswordVerificationFailed(); |
| 135 | 128 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 | 263 |
| 271 // Non-owning ptr to SigninScreenHandler instance. Should not be used | 264 // Non-owning ptr to SigninScreenHandler instance. Should not be used |
| 272 // in dtor. | 265 // in dtor. |
| 273 // TODO (antrim@): GaiaScreenHandler shouldn't communicate with | 266 // TODO (antrim@): GaiaScreenHandler shouldn't communicate with |
| 274 // signin_screen_handler directly. | 267 // signin_screen_handler directly. |
| 275 SigninScreenHandler* signin_screen_handler_; | 268 SigninScreenHandler* signin_screen_handler_; |
| 276 | 269 |
| 277 // GAIA extension loader. | 270 // GAIA extension loader. |
| 278 scoped_ptr<ScopedGaiaAuthExtension> auth_extension_; | 271 scoped_ptr<ScopedGaiaAuthExtension> auth_extension_; |
| 279 | 272 |
| 280 // Temporary DeviceId to be used for new users. | |
| 281 // If it's empty, new deviceId should be generated. | |
| 282 std::string temporary_device_id_; | |
| 283 | |
| 284 base::WeakPtrFactory<GaiaScreenHandler> weak_factory_; | 273 base::WeakPtrFactory<GaiaScreenHandler> weak_factory_; |
| 285 | 274 |
| 286 DISALLOW_COPY_AND_ASSIGN(GaiaScreenHandler); | 275 DISALLOW_COPY_AND_ASSIGN(GaiaScreenHandler); |
| 287 }; | 276 }; |
| 288 | 277 |
| 289 } // namespace chromeos | 278 } // namespace chromeos |
| 290 | 279 |
| 291 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_GAIA_SCREEN_HANDLER_H_ | 280 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_GAIA_SCREEN_HANDLER_H_ |
| OLD | NEW |