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 "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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 | 68 |
| 69 // BaseScreenHandler implementation: | 69 // BaseScreenHandler implementation: |
| 70 virtual void DeclareLocalizedValues(LocalizedValuesBuilder* builder) OVERRIDE; | 70 virtual void DeclareLocalizedValues(LocalizedValuesBuilder* builder) OVERRIDE; |
| 71 virtual void Initialize() OVERRIDE; | 71 virtual void Initialize() OVERRIDE; |
| 72 | 72 |
| 73 // WebUIMessageHandler implementation: | 73 // WebUIMessageHandler implementation: |
| 74 virtual void RegisterMessages() OVERRIDE; | 74 virtual void RegisterMessages() OVERRIDE; |
| 75 | 75 |
| 76 // WebUI message handlers. | 76 // WebUI message handlers. |
| 77 void HandleFrameLoadingCompleted(int status); | 77 void HandleFrameLoadingCompleted(int status); |
| 78 void HandleCompleteAuthentication(const std::string& email, | |
| 79 const std::string& password, | |
| 80 const std::string& auth_code); | |
| 81 void HandleCompleteLogin(const std::string& typed_email, | |
| 82 const std::string& password, | |
| 83 bool using_saml); | |
| 84 | |
| 85 void HandleUsingSAMLAPI(); | |
| 86 void HandleScrapedPasswordCount(int password_count); | |
| 87 void HandleScrapedPasswordVerificationFailed(); | |
| 88 | |
| 89 void HandleGaiaUIReady(); | |
| 90 | |
| 91 void PopulateEmail(const std::string& user_id); | |
|
Nikita (slow)
2014/06/02 14:18:29
nit: Add comment.
Denis Kuznetsov (DE-MUC)
2014/06/02 16:47:01
Done.
| |
| 92 // Mark user as having password changed: | |
| 93 void PasswordChangedFor(const std::string& user_id); | |
| 94 | |
| 95 // Kick off cookie / local storage cleanup. | |
| 96 void StartClearingCookies(const base::Closure& on_clear_callback); | |
| 97 void OnCookiesCleared(base::Closure on_clear_callback); | |
| 98 | |
| 99 // Kick off DNS cache flushing. | |
| 100 void StartClearingDnsCache(); | |
| 101 void OnDnsCleared(); | |
| 102 | |
| 103 // Show sign-in screen for the given credentials. | |
| 104 virtual void ShowSigninScreenForCreds(const std::string& username, | |
| 105 const std::string& password); | |
| 106 // Attempts login for test. | |
| 107 void SubmitLoginFormForTest(); | |
| 108 | |
| 109 // Updates the member variable and UMA histogram indicating whether the | |
| 110 // principals API was used during SAML login. | |
| 111 void SetSAMLPrincipalsAPIUsed(bool api_used); | |
| 112 | |
| 113 void ShowGaia(); | |
| 114 | |
| 115 // Shows signin screen after dns cache and cookie cleanup operations finish. | |
| 116 void ShowGaiaScreenIfReady(); | |
| 117 // Decides whether an auth extension should be pre-loaded. If it should, | |
|
Nikita (slow)
2014/06/02 14:18:29
nit: Insert empty line before comment.
Denis Kuznetsov (DE-MUC)
2014/06/02 16:47:01
Done.
| |
| 118 // pre-loads it. | |
| 119 void MaybePreloadAuthExtension(); | |
| 120 // Tells webui to load authentication extension. |force| is used to force the | |
|
Nikita (slow)
2014/06/02 14:18:29
nit: Insert empty line before comment.
Denis Kuznetsov (DE-MUC)
2014/06/02 16:47:01
Done.
| |
| 121 // extension reloading, if it has already been loaded. |silent_load| is true | |
| 122 // for cases when extension should be loaded in the background and it | |
| 123 // shouldn't grab the focus. |offline| is true when offline version of the | |
| 124 // extension should be used. | |
| 125 void LoadAuthExtension(bool force, bool silent_load, bool offline); | |
| 78 | 126 |
| 79 // TODO (ygorshenin@): GaiaScreenHandler should implement | 127 // TODO (ygorshenin@): GaiaScreenHandler should implement |
| 80 // NetworkStateInformer::Observer. | 128 // NetworkStateInformer::Observer. |
| 81 void UpdateState(ErrorScreenActor::ErrorReason reason); | 129 void UpdateState(ErrorScreenActor::ErrorReason reason); |
| 82 | 130 |
| 83 // TODO (ygorshenin@): remove this dependency. | 131 // TODO (ygorshenin@): remove this dependency. |
| 84 void SetSigninScreenHandler(SigninScreenHandler* handler); | 132 void SetSigninScreenHandler(SigninScreenHandler* handler); |
| 85 | 133 |
| 134 SigninScreenHandlerDelegate* Delegate(); | |
| 86 // Current state of Gaia frame. | 135 // Current state of Gaia frame. |
|
Nikita (slow)
2014/06/02 14:18:29
nit: Insert empty line before comment.
Denis Kuznetsov (DE-MUC)
2014/06/02 16:47:01
Done.
| |
| 87 FrameState frame_state_; | 136 FrameState frame_state_; |
| 88 | 137 |
| 89 // Latest Gaia frame error. | 138 // Latest Gaia frame error. |
| 90 net::Error frame_error_; | 139 net::Error frame_error_; |
| 91 | 140 |
| 92 // Network state informer used to keep signin screen up. | 141 // Network state informer used to keep signin screen up. |
| 93 scoped_refptr<NetworkStateInformer> network_state_informer_; | 142 scoped_refptr<NetworkStateInformer> network_state_informer_; |
| 94 | 143 |
| 144 // Email to pre-populate with. | |
| 145 std::string populated_email_; | |
| 146 | |
| 147 // Emails of the users, whose passwords have recently been changed. | |
| 148 std::set<std::string> password_changed_for_; | |
| 149 | |
| 150 // True if dns cache cleanup is done. | |
| 151 bool dns_cleared_; | |
| 152 | |
| 153 // True if DNS cache task is already running. | |
| 154 bool dns_clear_task_running_; | |
| 155 | |
| 156 // True if cookie jar cleanup is done. | |
| 157 bool cookies_cleared_; | |
| 158 | |
| 159 // Is focus still stolen from Gaia page? | |
| 160 bool focus_stolen_; | |
| 161 | |
| 162 // Has Gaia page silent load been started for the current sign-in attempt? | |
| 163 bool gaia_silent_load_; | |
| 164 | |
| 165 // The active network at the moment when Gaia page was preloaded. | |
| 166 std::string gaia_silent_load_network_; | |
| 167 | |
| 168 // If the user authenticated via SAML, this indicates whether the principals | |
| 169 // API was used. | |
| 170 bool using_saml_api_; | |
| 171 | |
| 172 // Test credentials. | |
| 173 std::string test_user_; | |
| 174 std::string test_pass_; | |
| 175 bool test_expects_complete_login_; | |
| 176 | |
| 95 // Non-owning ptr to SigninScreenHandler instance. Should not be used | 177 // Non-owning ptr to SigninScreenHandler instance. Should not be used |
| 96 // in dtor. | 178 // in dtor. |
| 97 // TODO (ygorshenin@): GaiaScreenHandler shouldn't communicate with | 179 // TODO (ygorshenin@): GaiaScreenHandler shouldn't communicate with |
| 98 // signin_screen_handler directly. | 180 // signin_screen_handler directly. |
| 99 SigninScreenHandler* signin_screen_handler_; | 181 SigninScreenHandler* signin_screen_handler_; |
| 100 | 182 |
| 183 base::WeakPtrFactory<GaiaScreenHandler> weak_factory_; | |
| 184 | |
| 101 DISALLOW_COPY_AND_ASSIGN(GaiaScreenHandler); | 185 DISALLOW_COPY_AND_ASSIGN(GaiaScreenHandler); |
| 102 }; | 186 }; |
| 103 | 187 |
| 104 } // namespace chromeos | 188 } // namespace chromeos |
| 105 | 189 |
| 106 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_GAIA_SCREEN_HANDLER_H_ | 190 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_GAIA_SCREEN_HANDLER_H_ |
| OLD | NEW |