Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(851)

Unified Diff: chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h

Issue 304303005: ChromeOS login webui refactoring : Move GAIA-related code to gaia_screen_handler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h
diff --git a/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h b/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h
index 520ac36801d6763c87526016e2a40b409e2af22b..5a333c42ef4894037c69539392686f8be4b643db 100644
--- a/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h
+++ b/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h
@@ -75,6 +75,58 @@ class GaiaScreenHandler : public BaseScreenHandler {
// WebUI message handlers.
void HandleFrameLoadingCompleted(int status);
+ void HandleCompleteAuthentication(const std::string& email,
+ const std::string& password,
+ const std::string& auth_code);
+ void HandleCompleteLogin(const std::string& typed_email,
+ const std::string& password,
+ bool using_saml);
+
+ void HandleUsingSAMLAPI();
+ void HandleScrapedPasswordCount(int password_count);
+ void HandleScrapedPasswordVerificationFailed();
+
+ void HandleGaiaUIReady();
+
+ // Fill GAIA user name.
+ void PopulateEmail(const std::string& user_id);
+
+ // Mark user as having password changed:
+ void PasswordChangedFor(const std::string& user_id);
+
+ // Kick off cookie / local storage cleanup.
+ void StartClearingCookies(const base::Closure& on_clear_callback);
+ void OnCookiesCleared(base::Closure on_clear_callback);
ygorshenin1 2014/06/03 17:48:04 nit: for consistency user const base::Closure& dat
+
+ // Kick off DNS cache flushing.
+ void StartClearingDnsCache();
+ void OnDnsCleared();
+
+ // Show sign-in screen for the given credentials.
+ virtual void ShowSigninScreenForCreds(const std::string& username,
+ const std::string& password);
+ // Attempts login for test.
+ void SubmitLoginFormForTest();
+
+ // Updates the member variable and UMA histogram indicating whether the
+ // principals API was used during SAML login.
+ void SetSAMLPrincipalsAPIUsed(bool api_used);
+
+ void ShowGaia();
+
+ // Shows signin screen after dns cache and cookie cleanup operations finish.
+ void ShowGaiaScreenIfReady();
+
+ // Decides whether an auth extension should be pre-loaded. If it should,
+ // pre-loads it.
+ void MaybePreloadAuthExtension();
+
+ // Tells webui to load authentication extension. |force| is used to force the
+ // extension reloading, if it has already been loaded. |silent_load| is true
+ // for cases when extension should be loaded in the background and it
+ // shouldn't grab the focus. |offline| is true when offline version of the
+ // extension should be used.
+ void LoadAuthExtension(bool force, bool silent_load, bool offline);
// TODO (ygorshenin@): GaiaScreenHandler should implement
// NetworkStateInformer::Observer.
@@ -83,6 +135,8 @@ class GaiaScreenHandler : public BaseScreenHandler {
// TODO (ygorshenin@): remove this dependency.
void SetSigninScreenHandler(SigninScreenHandler* handler);
+ SigninScreenHandlerDelegate* Delegate();
+
// Current state of Gaia frame.
FrameState frame_state_;
@@ -92,12 +146,47 @@ class GaiaScreenHandler : public BaseScreenHandler {
// Network state informer used to keep signin screen up.
scoped_refptr<NetworkStateInformer> network_state_informer_;
+ // Email to pre-populate with.
+ std::string populated_email_;
+
+ // Emails of the users, whose passwords have recently been changed.
+ std::set<std::string> password_changed_for_;
+
+ // True if dns cache cleanup is done.
+ bool dns_cleared_;
+
+ // True if DNS cache task is already running.
+ bool dns_clear_task_running_;
+
+ // True if cookie jar cleanup is done.
+ bool cookies_cleared_;
+
+ // Is focus still stolen from Gaia page?
+ bool focus_stolen_;
+
+ // Has Gaia page silent load been started for the current sign-in attempt?
+ bool gaia_silent_load_;
+
+ // The active network at the moment when Gaia page was preloaded.
+ std::string gaia_silent_load_network_;
+
+ // If the user authenticated via SAML, this indicates whether the principals
+ // API was used.
+ bool using_saml_api_;
+
+ // Test credentials.
+ std::string test_user_;
+ std::string test_pass_;
+ bool test_expects_complete_login_;
+
// Non-owning ptr to SigninScreenHandler instance. Should not be used
// in dtor.
// TODO (ygorshenin@): GaiaScreenHandler shouldn't communicate with
// signin_screen_handler directly.
SigninScreenHandler* signin_screen_handler_;
+ base::WeakPtrFactory<GaiaScreenHandler> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(GaiaScreenHandler);
};

Powered by Google App Engine
This is Rietveld 408576698