| 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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 bool show_users; | 32 bool show_users; |
| 33 | 33 |
| 34 // Whether Gaia should be loaded in offline mode. | 34 // Whether Gaia should be loaded in offline mode. |
| 35 bool use_offline; | 35 bool use_offline; |
| 36 | 36 |
| 37 // True if user list is non-empty. | 37 // True if user list is non-empty. |
| 38 bool has_users; | 38 bool has_users; |
| 39 | 39 |
| 40 // Email of current user. | 40 // Email of current user. |
| 41 std::string email; | 41 std::string email; |
| 42 |
| 43 // Whether consumer management enrollment is in progress. |
| 44 bool is_enrolling_consumer_management; |
| 42 }; | 45 }; |
| 43 | 46 |
| 44 // A class that handles WebUI hooks in Gaia screen. | 47 // A class that handles WebUI hooks in Gaia screen. |
| 45 class GaiaScreenHandler : public BaseScreenHandler { | 48 class GaiaScreenHandler : public BaseScreenHandler { |
| 46 public: | 49 public: |
| 47 enum FrameState { | 50 enum FrameState { |
| 48 FRAME_STATE_UNKNOWN = 0, | 51 FRAME_STATE_UNKNOWN = 0, |
| 49 FRAME_STATE_LOADING, | 52 FRAME_STATE_LOADING, |
| 50 FRAME_STATE_LOADED, | 53 FRAME_STATE_LOADED, |
| 51 FRAME_STATE_ERROR | 54 FRAME_STATE_ERROR |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // Show sign-in screen for the given credentials. | 112 // Show sign-in screen for the given credentials. |
| 110 virtual void ShowSigninScreenForCreds(const std::string& username, | 113 virtual void ShowSigninScreenForCreds(const std::string& username, |
| 111 const std::string& password); | 114 const std::string& password); |
| 112 // Attempts login for test. | 115 // Attempts login for test. |
| 113 void SubmitLoginFormForTest(); | 116 void SubmitLoginFormForTest(); |
| 114 | 117 |
| 115 // Updates the member variable and UMA histogram indicating whether the | 118 // Updates the member variable and UMA histogram indicating whether the |
| 116 // principals API was used during SAML login. | 119 // principals API was used during SAML login. |
| 117 void SetSAMLPrincipalsAPIUsed(bool api_used); | 120 void SetSAMLPrincipalsAPIUsed(bool api_used); |
| 118 | 121 |
| 119 void ShowGaia(); | 122 void ShowGaia(bool is_enrolling_consumer_management); |
| 120 | 123 |
| 121 // Shows signin screen after dns cache and cookie cleanup operations finish. | 124 // Shows signin screen after dns cache and cookie cleanup operations finish. |
| 122 void ShowGaiaScreenIfReady(); | 125 void ShowGaiaScreenIfReady(); |
| 123 | 126 |
| 124 // Decides whether an auth extension should be pre-loaded. If it should, | 127 // Decides whether an auth extension should be pre-loaded. If it should, |
| 125 // pre-loads it. | 128 // pre-loads it. |
| 126 void MaybePreloadAuthExtension(); | 129 void MaybePreloadAuthExtension(); |
| 127 | 130 |
| 128 // Tells webui to load authentication extension. |force| is used to force the | 131 // Tells webui to load authentication extension. |force| is used to force the |
| 129 // extension reloading, if it has already been loaded. |silent_load| is true | 132 // extension reloading, if it has already been loaded. |silent_load| is true |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 // Has Gaia page silent load been started for the current sign-in attempt? | 174 // Has Gaia page silent load been started for the current sign-in attempt? |
| 172 bool gaia_silent_load_; | 175 bool gaia_silent_load_; |
| 173 | 176 |
| 174 // The active network at the moment when Gaia page was preloaded. | 177 // The active network at the moment when Gaia page was preloaded. |
| 175 std::string gaia_silent_load_network_; | 178 std::string gaia_silent_load_network_; |
| 176 | 179 |
| 177 // If the user authenticated via SAML, this indicates whether the principals | 180 // If the user authenticated via SAML, this indicates whether the principals |
| 178 // API was used. | 181 // API was used. |
| 179 bool using_saml_api_; | 182 bool using_saml_api_; |
| 180 | 183 |
| 184 // Whether consumer management enrollment is in progress. |
| 185 bool is_enrolling_consumer_management_; |
| 186 |
| 181 // Test credentials. | 187 // Test credentials. |
| 182 std::string test_user_; | 188 std::string test_user_; |
| 183 std::string test_pass_; | 189 std::string test_pass_; |
| 184 bool test_expects_complete_login_; | 190 bool test_expects_complete_login_; |
| 185 | 191 |
| 186 // Non-owning ptr to SigninScreenHandler instance. Should not be used | 192 // Non-owning ptr to SigninScreenHandler instance. Should not be used |
| 187 // in dtor. | 193 // in dtor. |
| 188 // TODO (ygorshenin@): GaiaScreenHandler shouldn't communicate with | 194 // TODO (ygorshenin@): GaiaScreenHandler shouldn't communicate with |
| 189 // signin_screen_handler directly. | 195 // signin_screen_handler directly. |
| 190 SigninScreenHandler* signin_screen_handler_; | 196 SigninScreenHandler* signin_screen_handler_; |
| 191 | 197 |
| 192 base::WeakPtrFactory<GaiaScreenHandler> weak_factory_; | 198 base::WeakPtrFactory<GaiaScreenHandler> weak_factory_; |
| 193 | 199 |
| 194 DISALLOW_COPY_AND_ASSIGN(GaiaScreenHandler); | 200 DISALLOW_COPY_AND_ASSIGN(GaiaScreenHandler); |
| 195 }; | 201 }; |
| 196 | 202 |
| 197 } // namespace chromeos | 203 } // namespace chromeos |
| 198 | 204 |
| 199 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_GAIA_SCREEN_HANDLER_H_ | 205 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_GAIA_SCREEN_HANDLER_H_ |
| OLD | NEW |