Chromium Code Reviews| 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> | |
| 9 | |
| 8 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 9 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 10 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 11 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" | 13 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" |
| 12 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
| 13 | 15 |
| 16 namespace policy { | |
| 17 class ConsumerManagementService; | |
| 18 } | |
| 19 | |
| 14 namespace chromeos { | 20 namespace chromeos { |
| 15 | 21 |
| 16 class SigninScreenHandler; | 22 class SigninScreenHandler; |
| 17 | 23 |
| 18 // A class that's used to specify the way how Gaia should be loaded. | 24 // A class that's used to specify the way how Gaia should be loaded. |
| 19 struct GaiaContext { | 25 struct GaiaContext { |
| 20 GaiaContext(); | 26 GaiaContext(); |
| 21 | 27 |
| 22 // Forces Gaia to reload. | 28 // Forces Gaia to reload. |
| 23 bool force_reload; | 29 bool force_reload; |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 47 // A class that handles WebUI hooks in Gaia screen. | 53 // A class that handles WebUI hooks in Gaia screen. |
| 48 class GaiaScreenHandler : public BaseScreenHandler { | 54 class GaiaScreenHandler : public BaseScreenHandler { |
| 49 public: | 55 public: |
| 50 enum FrameState { | 56 enum FrameState { |
| 51 FRAME_STATE_UNKNOWN = 0, | 57 FRAME_STATE_UNKNOWN = 0, |
| 52 FRAME_STATE_LOADING, | 58 FRAME_STATE_LOADING, |
| 53 FRAME_STATE_LOADED, | 59 FRAME_STATE_LOADED, |
| 54 FRAME_STATE_ERROR | 60 FRAME_STATE_ERROR |
| 55 }; | 61 }; |
| 56 | 62 |
| 57 explicit GaiaScreenHandler( | 63 GaiaScreenHandler( |
| 58 const scoped_refptr<NetworkStateInformer>& network_state_informer); | 64 const scoped_refptr<NetworkStateInformer>& network_state_informer, |
| 65 policy::ConsumerManagementService* consumer_management); | |
| 59 virtual ~GaiaScreenHandler(); | 66 virtual ~GaiaScreenHandler(); |
| 60 | 67 |
| 61 void LoadGaia(const GaiaContext& context); | 68 void LoadGaia(const GaiaContext& context); |
| 62 void UpdateGaia(const GaiaContext& context); | 69 void UpdateGaia(const GaiaContext& context); |
| 63 | 70 |
| 64 // Sends request to reload Gaia. If |force_reload| is true, request | 71 // Sends request to reload Gaia. If |force_reload| is true, request |
| 65 // will be sent in any case, otherwise it will be sent only when Gaia is | 72 // will be sent in any case, otherwise it will be sent only when Gaia is |
| 66 // not loading right now. | 73 // not loading right now. |
| 67 void ReloadGaia(bool force_reload); | 74 void ReloadGaia(bool force_reload); |
| 68 | 75 |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 88 void HandleCompleteLogin(const std::string& typed_email, | 95 void HandleCompleteLogin(const std::string& typed_email, |
| 89 const std::string& password, | 96 const std::string& password, |
| 90 bool using_saml); | 97 bool using_saml); |
| 91 | 98 |
| 92 void HandleUsingSAMLAPI(); | 99 void HandleUsingSAMLAPI(); |
| 93 void HandleScrapedPasswordCount(int password_count); | 100 void HandleScrapedPasswordCount(int password_count); |
| 94 void HandleScrapedPasswordVerificationFailed(); | 101 void HandleScrapedPasswordVerificationFailed(); |
| 95 | 102 |
| 96 void HandleGaiaUIReady(); | 103 void HandleGaiaUIReady(); |
| 97 | 104 |
| 105 void OnSetOwnerDone(const std::string& typed_email, | |
| 106 const std::string& password, | |
| 107 bool using_saml, | |
| 108 bool success); | |
| 109 | |
| 110 void DoCompleteLogin(const std::string& typed_email, | |
| 111 const std::string& password, | |
| 112 bool using_saml); | |
| 113 | |
| 98 // Fill GAIA user name. | 114 // Fill GAIA user name. |
| 99 void PopulateEmail(const std::string& user_id); | 115 void PopulateEmail(const std::string& user_id); |
| 100 | 116 |
| 101 // Mark user as having password changed: | 117 // Mark user as having password changed: |
| 102 void PasswordChangedFor(const std::string& user_id); | 118 void PasswordChangedFor(const std::string& user_id); |
| 103 | 119 |
| 104 // Kick off cookie / local storage cleanup. | 120 // Kick off cookie / local storage cleanup. |
| 105 void StartClearingCookies(const base::Closure& on_clear_callback); | 121 void StartClearingCookies(const base::Closure& on_clear_callback); |
| 106 void OnCookiesCleared(const base::Closure& on_clear_callback); | 122 void OnCookiesCleared(const base::Closure& on_clear_callback); |
| 107 | 123 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 146 | 162 |
| 147 // Current state of Gaia frame. | 163 // Current state of Gaia frame. |
| 148 FrameState frame_state_; | 164 FrameState frame_state_; |
| 149 | 165 |
| 150 // Latest Gaia frame error. | 166 // Latest Gaia frame error. |
| 151 net::Error frame_error_; | 167 net::Error frame_error_; |
| 152 | 168 |
| 153 // Network state informer used to keep signin screen up. | 169 // Network state informer used to keep signin screen up. |
| 154 scoped_refptr<NetworkStateInformer> network_state_informer_; | 170 scoped_refptr<NetworkStateInformer> network_state_informer_; |
| 155 | 171 |
| 172 // Consumer management service for checking if the enrollment is in progress. | |
|
bartfab (slow)
2014/08/05 18:07:13
Nit: s/the //
davidyu
2014/08/06 03:04:32
Done.
| |
| 173 policy::ConsumerManagementService* consumer_management_; | |
|
bartfab (slow)
2014/08/05 18:07:13
Nit: As in consumer_management_handler.h, I think
davidyu
2014/08/06 03:04:32
Done.
| |
| 174 | |
| 156 // Email to pre-populate with. | 175 // Email to pre-populate with. |
| 157 std::string populated_email_; | 176 std::string populated_email_; |
| 158 | 177 |
| 159 // Emails of the users, whose passwords have recently been changed. | 178 // Emails of the users, whose passwords have recently been changed. |
| 160 std::set<std::string> password_changed_for_; | 179 std::set<std::string> password_changed_for_; |
| 161 | 180 |
| 162 // True if dns cache cleanup is done. | 181 // True if dns cache cleanup is done. |
| 163 bool dns_cleared_; | 182 bool dns_cleared_; |
| 164 | 183 |
| 165 // True if DNS cache task is already running. | 184 // True if DNS cache task is already running. |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 196 SigninScreenHandler* signin_screen_handler_; | 215 SigninScreenHandler* signin_screen_handler_; |
| 197 | 216 |
| 198 base::WeakPtrFactory<GaiaScreenHandler> weak_factory_; | 217 base::WeakPtrFactory<GaiaScreenHandler> weak_factory_; |
| 199 | 218 |
| 200 DISALLOW_COPY_AND_ASSIGN(GaiaScreenHandler); | 219 DISALLOW_COPY_AND_ASSIGN(GaiaScreenHandler); |
| 201 }; | 220 }; |
| 202 | 221 |
| 203 } // namespace chromeos | 222 } // namespace chromeos |
| 204 | 223 |
| 205 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_GAIA_SCREEN_HANDLER_H_ | 224 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_GAIA_SCREEN_HANDLER_H_ |
| OLD | NEW |