| 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 // This is called when ConsumerManagementService::SetOwner() returns. |
| 106 void OnSetOwnerDone(const std::string& typed_email, |
| 107 const std::string& password, |
| 108 bool using_saml, |
| 109 bool success); |
| 110 |
| 111 // Really handles the complete login message. |
| 112 void DoCompleteLogin(const std::string& typed_email, |
| 113 const std::string& password, |
| 114 bool using_saml); |
| 115 |
| 98 // Fill GAIA user name. | 116 // Fill GAIA user name. |
| 99 void PopulateEmail(const std::string& user_id); | 117 void PopulateEmail(const std::string& user_id); |
| 100 | 118 |
| 101 // Mark user as having password changed: | 119 // Mark user as having password changed: |
| 102 void PasswordChangedFor(const std::string& user_id); | 120 void PasswordChangedFor(const std::string& user_id); |
| 103 | 121 |
| 104 // Kick off cookie / local storage cleanup. | 122 // Kick off cookie / local storage cleanup. |
| 105 void StartClearingCookies(const base::Closure& on_clear_callback); | 123 void StartClearingCookies(const base::Closure& on_clear_callback); |
| 106 void OnCookiesCleared(const base::Closure& on_clear_callback); | 124 void OnCookiesCleared(const base::Closure& on_clear_callback); |
| 107 | 125 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 164 |
| 147 // Current state of Gaia frame. | 165 // Current state of Gaia frame. |
| 148 FrameState frame_state_; | 166 FrameState frame_state_; |
| 149 | 167 |
| 150 // Latest Gaia frame error. | 168 // Latest Gaia frame error. |
| 151 net::Error frame_error_; | 169 net::Error frame_error_; |
| 152 | 170 |
| 153 // Network state informer used to keep signin screen up. | 171 // Network state informer used to keep signin screen up. |
| 154 scoped_refptr<NetworkStateInformer> network_state_informer_; | 172 scoped_refptr<NetworkStateInformer> network_state_informer_; |
| 155 | 173 |
| 174 // Consumer management service for checking if enrollment is in progress. |
| 175 policy::ConsumerManagementService* consumer_management_; |
| 176 |
| 156 // Email to pre-populate with. | 177 // Email to pre-populate with. |
| 157 std::string populated_email_; | 178 std::string populated_email_; |
| 158 | 179 |
| 159 // Emails of the users, whose passwords have recently been changed. | 180 // Emails of the users, whose passwords have recently been changed. |
| 160 std::set<std::string> password_changed_for_; | 181 std::set<std::string> password_changed_for_; |
| 161 | 182 |
| 162 // True if dns cache cleanup is done. | 183 // True if dns cache cleanup is done. |
| 163 bool dns_cleared_; | 184 bool dns_cleared_; |
| 164 | 185 |
| 165 // True if DNS cache task is already running. | 186 // True if DNS cache task is already running. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 196 SigninScreenHandler* signin_screen_handler_; | 217 SigninScreenHandler* signin_screen_handler_; |
| 197 | 218 |
| 198 base::WeakPtrFactory<GaiaScreenHandler> weak_factory_; | 219 base::WeakPtrFactory<GaiaScreenHandler> weak_factory_; |
| 199 | 220 |
| 200 DISALLOW_COPY_AND_ASSIGN(GaiaScreenHandler); | 221 DISALLOW_COPY_AND_ASSIGN(GaiaScreenHandler); |
| 201 }; | 222 }; |
| 202 | 223 |
| 203 } // namespace chromeos | 224 } // namespace chromeos |
| 204 | 225 |
| 205 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_GAIA_SCREEN_HANDLER_H_ | 226 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_GAIA_SCREEN_HANDLER_H_ |
| OLD | NEW |