| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 bool use_offline; | 45 bool use_offline; |
| 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 current user. | 50 // Email of current user. |
| 51 std::string email; | 51 std::string email; |
| 52 | 52 |
| 53 // Whether consumer management enrollment is in progress. | 53 // Whether consumer management enrollment is in progress. |
| 54 bool is_enrolling_consumer_management; | 54 bool is_enrolling_consumer_management; |
| 55 | |
| 56 // True if embedded_signin is enabled. | |
| 57 bool embedded_signin_enabled; | |
| 58 }; | 55 }; |
| 59 | 56 |
| 60 // A class that handles WebUI hooks in Gaia screen. | 57 // A class that handles WebUI hooks in Gaia screen. |
| 61 class GaiaScreenHandler : public BaseScreenHandler { | 58 class GaiaScreenHandler : public BaseScreenHandler { |
| 62 public: | 59 public: |
| 63 enum FrameState { | 60 enum FrameState { |
| 64 FRAME_STATE_UNKNOWN = 0, | 61 FRAME_STATE_UNKNOWN = 0, |
| 65 FRAME_STATE_LOADING, | 62 FRAME_STATE_LOADING, |
| 66 FRAME_STATE_LOADED, | 63 FRAME_STATE_LOADED, |
| 67 FRAME_STATE_ERROR | 64 FRAME_STATE_ERROR |
| 68 }; | 65 }; |
| 69 | 66 |
| 70 GaiaScreenHandler( | 67 GaiaScreenHandler( |
| 71 CoreOobeActor* core_oobe_actor, | 68 CoreOobeActor* core_oobe_actor, |
| 72 const scoped_refptr<NetworkStateInformer>& network_state_informer, | 69 const scoped_refptr<NetworkStateInformer>& network_state_informer, |
| 73 policy::ConsumerManagementService* consumer_management); | 70 policy::ConsumerManagementService* consumer_management); |
| 74 ~GaiaScreenHandler() override; | 71 ~GaiaScreenHandler() override; |
| 75 | 72 |
| 76 void LoadGaia(const GaiaContext& context); | 73 void LoadGaia(const GaiaContext& context); |
| 77 void UpdateGaia(const GaiaContext& context); | 74 void UpdateGaia(const GaiaContext& context); |
| 78 | 75 |
| 79 // Sends request to reload Gaia. If |force_reload| is true, request | 76 // Sends request to reload Gaia. If |force_reload| is true, request |
| 80 // will be sent in any case, otherwise it will be sent only when Gaia is | 77 // will be sent in any case, otherwise it will be sent only when Gaia is |
| 81 // not loading right now. | 78 // not loading right now. |
| 82 void ReloadGaia(bool force_reload); | 79 void ReloadGaia(bool force_reload); |
| 83 | 80 |
| 84 // Reload gaia with embedded signin frame. | |
| 85 void SwitchToEmbeddedSignin(); | |
| 86 | |
| 87 // Cancel embedded signin for the next load. | |
| 88 void CancelEmbeddedSignin(); | |
| 89 | |
| 90 // Decides whether an auth extension should be pre-loaded. If it should, | 81 // Decides whether an auth extension should be pre-loaded. If it should, |
| 91 // pre-loads it. | 82 // pre-loads it. |
| 92 void MaybePreloadAuthExtension(); | 83 void MaybePreloadAuthExtension(); |
| 93 | 84 |
| 94 FrameState frame_state() const { return frame_state_; } | 85 FrameState frame_state() const { return frame_state_; } |
| 95 net::Error frame_error() const { return frame_error_; } | 86 net::Error frame_error() const { return frame_error_; } |
| 96 | 87 |
| 97 private: | 88 private: |
| 98 // TODO (antrim@): remove this dependency. | 89 // TODO (antrim@): remove this dependency. |
| 99 friend class SigninScreenHandler; | 90 friend class SigninScreenHandler; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 118 const std::string& typed_email, | 109 const std::string& typed_email, |
| 119 const std::string& password, | 110 const std::string& password, |
| 120 bool using_saml); | 111 bool using_saml); |
| 121 | 112 |
| 122 void HandleUsingSAMLAPI(); | 113 void HandleUsingSAMLAPI(); |
| 123 void HandleScrapedPasswordCount(int password_count); | 114 void HandleScrapedPasswordCount(int password_count); |
| 124 void HandleScrapedPasswordVerificationFailed(); | 115 void HandleScrapedPasswordVerificationFailed(); |
| 125 | 116 |
| 126 void HandleGaiaUIReady(); | 117 void HandleGaiaUIReady(); |
| 127 | 118 |
| 128 void HandleSwitchToFullTab(); | |
| 129 void HandleToggleEasyBootstrap(); | 119 void HandleToggleEasyBootstrap(); |
| 130 | 120 |
| 131 void HandleToggleWebviewSignin(); | 121 void HandleToggleWebviewSignin(); |
| 132 | 122 |
| 133 // This is called when ConsumerManagementService::SetOwner() returns. | 123 // This is called when ConsumerManagementService::SetOwner() returns. |
| 134 void OnSetOwnerDone(const std::string& gaia_id, | 124 void OnSetOwnerDone(const std::string& gaia_id, |
| 135 const std::string& typed_email, | 125 const std::string& typed_email, |
| 136 const std::string& password, | 126 const std::string& password, |
| 137 bool using_saml, | 127 bool using_saml, |
| 138 bool success); | 128 bool success); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 bool using_saml_api_; | 234 bool using_saml_api_; |
| 245 | 235 |
| 246 // Whether consumer management enrollment is in progress. | 236 // Whether consumer management enrollment is in progress. |
| 247 bool is_enrolling_consumer_management_; | 237 bool is_enrolling_consumer_management_; |
| 248 | 238 |
| 249 // Test credentials. | 239 // Test credentials. |
| 250 std::string test_user_; | 240 std::string test_user_; |
| 251 std::string test_pass_; | 241 std::string test_pass_; |
| 252 bool test_expects_complete_login_; | 242 bool test_expects_complete_login_; |
| 253 | 243 |
| 254 // True if user pressed shortcut to enable embedded signin. | |
| 255 bool embedded_signin_enabled_by_shortcut_; | |
| 256 | |
| 257 // True if Easy bootstrap is enabled. | 244 // True if Easy bootstrap is enabled. |
| 258 bool use_easy_bootstrap_; | 245 bool use_easy_bootstrap_; |
| 259 | 246 |
| 260 // Non-owning ptr to SigninScreenHandler instance. Should not be used | 247 // Non-owning ptr to SigninScreenHandler instance. Should not be used |
| 261 // in dtor. | 248 // in dtor. |
| 262 // TODO (antrim@): GaiaScreenHandler shouldn't communicate with | 249 // TODO (antrim@): GaiaScreenHandler shouldn't communicate with |
| 263 // signin_screen_handler directly. | 250 // signin_screen_handler directly. |
| 264 SigninScreenHandler* signin_screen_handler_; | 251 SigninScreenHandler* signin_screen_handler_; |
| 265 | 252 |
| 266 // GAIA extension loader. | 253 // GAIA extension loader. |
| 267 scoped_ptr<ScopedGaiaAuthExtension> auth_extension_; | 254 scoped_ptr<ScopedGaiaAuthExtension> auth_extension_; |
| 268 | 255 |
| 269 base::WeakPtrFactory<GaiaScreenHandler> weak_factory_; | 256 base::WeakPtrFactory<GaiaScreenHandler> weak_factory_; |
| 270 | 257 |
| 271 DISALLOW_COPY_AND_ASSIGN(GaiaScreenHandler); | 258 DISALLOW_COPY_AND_ASSIGN(GaiaScreenHandler); |
| 272 }; | 259 }; |
| 273 | 260 |
| 274 } // namespace chromeos | 261 } // namespace chromeos |
| 275 | 262 |
| 276 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_GAIA_SCREEN_HANDLER_H_ | 263 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_GAIA_SCREEN_HANDLER_H_ |
| OLD | NEW |