| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 bool use_offline; | 42 bool use_offline; |
| 43 | 43 |
| 44 // True if user list is non-empty. | 44 // True if user list is non-empty. |
| 45 bool has_users; | 45 bool has_users; |
| 46 | 46 |
| 47 // Email of current user. | 47 // Email of current user. |
| 48 std::string email; | 48 std::string email; |
| 49 | 49 |
| 50 // Whether consumer management enrollment is in progress. | 50 // Whether consumer management enrollment is in progress. |
| 51 bool is_enrolling_consumer_management; | 51 bool is_enrolling_consumer_management; |
| 52 |
| 53 // True if embedded_signin is enabled. |
| 54 bool embedded_signin_enabled; |
| 52 }; | 55 }; |
| 53 | 56 |
| 54 // A class that handles WebUI hooks in Gaia screen. | 57 // A class that handles WebUI hooks in Gaia screen. |
| 55 class GaiaScreenHandler : public BaseScreenHandler { | 58 class GaiaScreenHandler : public BaseScreenHandler { |
| 56 public: | 59 public: |
| 57 enum FrameState { | 60 enum FrameState { |
| 58 FRAME_STATE_UNKNOWN = 0, | 61 FRAME_STATE_UNKNOWN = 0, |
| 59 FRAME_STATE_LOADING, | 62 FRAME_STATE_LOADING, |
| 60 FRAME_STATE_LOADED, | 63 FRAME_STATE_LOADED, |
| 61 FRAME_STATE_ERROR | 64 FRAME_STATE_ERROR |
| 62 }; | 65 }; |
| 63 | 66 |
| 64 GaiaScreenHandler( | 67 GaiaScreenHandler( |
| 65 CoreOobeActor* core_oobe_actor, | 68 CoreOobeActor* core_oobe_actor, |
| 66 const scoped_refptr<NetworkStateInformer>& network_state_informer, | 69 const scoped_refptr<NetworkStateInformer>& network_state_informer, |
| 67 policy::ConsumerManagementService* consumer_management); | 70 policy::ConsumerManagementService* consumer_management); |
| 68 virtual ~GaiaScreenHandler(); | 71 virtual ~GaiaScreenHandler(); |
| 69 | 72 |
| 70 void LoadGaia(const GaiaContext& context); | 73 void LoadGaia(const GaiaContext& context); |
| 71 void UpdateGaia(const GaiaContext& context); | 74 void UpdateGaia(const GaiaContext& context); |
| 72 | 75 |
| 73 // Sends request to reload Gaia. If |force_reload| is true, request | 76 // Sends request to reload Gaia. If |force_reload| is true, request |
| 74 // 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 |
| 75 // not loading right now. | 78 // not loading right now. |
| 76 void ReloadGaia(bool force_reload); | 79 void ReloadGaia(bool force_reload); |
| 77 | 80 |
| 81 // Reload gaia with embedded signin frame. |
| 82 void SwitchToEmbeddedSignin(); |
| 83 |
| 84 // Cancel embedded signin for the next load. |
| 85 void CancelEmbeddedSignin(); |
| 86 |
| 78 FrameState frame_state() const { return frame_state_; } | 87 FrameState frame_state() const { return frame_state_; } |
| 79 net::Error frame_error() const { return frame_error_; } | 88 net::Error frame_error() const { return frame_error_; } |
| 80 | 89 |
| 81 private: | 90 private: |
| 82 // TODO (ygorshenin@): remove this dependency. | 91 // TODO (ygorshenin@): remove this dependency. |
| 83 friend class SigninScreenHandler; | 92 friend class SigninScreenHandler; |
| 84 | 93 |
| 85 // BaseScreenHandler implementation: | 94 // BaseScreenHandler implementation: |
| 86 virtual void DeclareLocalizedValues(LocalizedValuesBuilder* builder) override; | 95 virtual void DeclareLocalizedValues(LocalizedValuesBuilder* builder) override; |
| 87 virtual void Initialize() override; | 96 virtual void Initialize() override; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 bool using_saml_api_; | 216 bool using_saml_api_; |
| 208 | 217 |
| 209 // Whether consumer management enrollment is in progress. | 218 // Whether consumer management enrollment is in progress. |
| 210 bool is_enrolling_consumer_management_; | 219 bool is_enrolling_consumer_management_; |
| 211 | 220 |
| 212 // Test credentials. | 221 // Test credentials. |
| 213 std::string test_user_; | 222 std::string test_user_; |
| 214 std::string test_pass_; | 223 std::string test_pass_; |
| 215 bool test_expects_complete_login_; | 224 bool test_expects_complete_login_; |
| 216 | 225 |
| 226 // True if user pressed shortcut to enable embedded signin. |
| 227 bool embedded_signin_enabled_by_shortcut_; |
| 228 |
| 217 // Non-owning ptr to SigninScreenHandler instance. Should not be used | 229 // Non-owning ptr to SigninScreenHandler instance. Should not be used |
| 218 // in dtor. | 230 // in dtor. |
| 219 // TODO (ygorshenin@): GaiaScreenHandler shouldn't communicate with | 231 // TODO (ygorshenin@): GaiaScreenHandler shouldn't communicate with |
| 220 // signin_screen_handler directly. | 232 // signin_screen_handler directly. |
| 221 SigninScreenHandler* signin_screen_handler_; | 233 SigninScreenHandler* signin_screen_handler_; |
| 222 | 234 |
| 223 base::WeakPtrFactory<GaiaScreenHandler> weak_factory_; | 235 base::WeakPtrFactory<GaiaScreenHandler> weak_factory_; |
| 224 | 236 |
| 225 DISALLOW_COPY_AND_ASSIGN(GaiaScreenHandler); | 237 DISALLOW_COPY_AND_ASSIGN(GaiaScreenHandler); |
| 226 }; | 238 }; |
| 227 | 239 |
| 228 } // namespace chromeos | 240 } // namespace chromeos |
| 229 | 241 |
| 230 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_GAIA_SCREEN_HANDLER_H_ | 242 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_GAIA_SCREEN_HANDLER_H_ |
| OLD | NEW |