Commit 8d2266c6 authored by pavely@chromium.org's avatar pavely@chromium.org

Revert 275549 "Revert 275154 "ChromeOS login webui refactoring :..."

Tree doesn't compile, returning to original state.
> Revert 275154 "ChromeOS login webui refactoring : Move GAIA-rela..."
> 
> This change preventing me from reverting r275046 which seems to be causing
> failures in KioskTest
> http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%28dbg%29%283%29/builds/35748
> 
> > ChromeOS login webui refactoring : Move GAIA-related code to gaia_screen_handler
> > 
> > BUG=373314
> > R=nkostylev@chromium.org
> > 
> > Review URL: https://codereview.chromium.org/304303005
> 
> TBR=antrim@chromium.org
> 
> Review URL: https://codereview.chromium.org/310313006

TBR=pavely@chromium.org

Review URL: https://codereview.chromium.org/321633002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275556 0039d316-1c4b-4281-b951-d872f2087c98
parent 9c486559
...@@ -75,6 +75,58 @@ class GaiaScreenHandler : public BaseScreenHandler { ...@@ -75,6 +75,58 @@ class GaiaScreenHandler : public BaseScreenHandler {
// WebUI message handlers. // WebUI message handlers.
void HandleFrameLoadingCompleted(int status); 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(const base::Closure& on_clear_callback);
// 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 // TODO (ygorshenin@): GaiaScreenHandler should implement
// NetworkStateInformer::Observer. // NetworkStateInformer::Observer.
...@@ -83,6 +135,8 @@ class GaiaScreenHandler : public BaseScreenHandler { ...@@ -83,6 +135,8 @@ class GaiaScreenHandler : public BaseScreenHandler {
// TODO (ygorshenin@): remove this dependency. // TODO (ygorshenin@): remove this dependency.
void SetSigninScreenHandler(SigninScreenHandler* handler); void SetSigninScreenHandler(SigninScreenHandler* handler);
SigninScreenHandlerDelegate* Delegate();
// Current state of Gaia frame. // Current state of Gaia frame.
FrameState frame_state_; FrameState frame_state_;
...@@ -92,12 +146,47 @@ class GaiaScreenHandler : public BaseScreenHandler { ...@@ -92,12 +146,47 @@ class GaiaScreenHandler : public BaseScreenHandler {
// Network state informer used to keep signin screen up. // Network state informer used to keep signin screen up.
scoped_refptr<NetworkStateInformer> network_state_informer_; 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 // Non-owning ptr to SigninScreenHandler instance. Should not be used
// in dtor. // in dtor.
// TODO (ygorshenin@): GaiaScreenHandler shouldn't communicate with // TODO (ygorshenin@): GaiaScreenHandler shouldn't communicate with
// signin_screen_handler directly. // signin_screen_handler directly.
SigninScreenHandler* signin_screen_handler_; SigninScreenHandler* signin_screen_handler_;
base::WeakPtrFactory<GaiaScreenHandler> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(GaiaScreenHandler); DISALLOW_COPY_AND_ASSIGN(GaiaScreenHandler);
}; };
......
...@@ -44,6 +44,7 @@ namespace chromeos { ...@@ -44,6 +44,7 @@ namespace chromeos {
class AuthenticatedUserEmailRetriever; class AuthenticatedUserEmailRetriever;
class CaptivePortalWindowProxy; class CaptivePortalWindowProxy;
class CoreOobeActor; class CoreOobeActor;
class GaiaScreenHandler;
class LocallyManagedUserCreationScreenHandler; class LocallyManagedUserCreationScreenHandler;
class NativeWindowDelegate; class NativeWindowDelegate;
class User; class User;
...@@ -252,8 +253,9 @@ class SigninScreenHandler ...@@ -252,8 +253,9 @@ class SigninScreenHandler
UI_STATE_ACCOUNT_PICKER, UI_STATE_ACCOUNT_PICKER,
}; };
friend class ReportDnsCacheClearedOnUIThread; friend class GaiaScreenHandler;
friend class LocallyManagedUserCreationScreenHandler; friend class LocallyManagedUserCreationScreenHandler;
friend class ReportDnsCacheClearedOnUIThread;
void ShowImpl(); void ShowImpl();
...@@ -320,16 +322,6 @@ class SigninScreenHandler ...@@ -320,16 +322,6 @@ class SigninScreenHandler
const std::string& username) const OVERRIDE; const std::string& username) const OVERRIDE;
virtual void Unlock(const std::string& user_email) OVERRIDE; virtual void Unlock(const std::string& user_email) OVERRIDE;
// Shows signin screen after dns cache and cookie cleanup operations finish.
void ShowSigninScreenIfReady();
// 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);
// Updates authentication extension. Called when device settings that affect // Updates authentication extension. Called when device settings that affect
// sign-in (allow BWSI and allow whitelist) are changed. // sign-in (allow BWSI and allow whitelist) are changed.
void UserSettingsChanged(); void UserSettingsChanged();
...@@ -339,16 +331,7 @@ class SigninScreenHandler ...@@ -339,16 +331,7 @@ class SigninScreenHandler
void RefocusCurrentPod(); void RefocusCurrentPod();
// WebUI message handlers. // WebUI message handlers.
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 HandleGetUsers(); void HandleGetUsers();
void HandleUsingSAMLAPI();
void HandleScrapedPasswordCount(int password_count);
void HandleScrapedPasswordVerificationFailed();
void HandleAuthenticateUser(const std::string& username, void HandleAuthenticateUser(const std::string& username,
const std::string& password); const std::string& password);
void HandleAttemptUnlock(const std::string& username); void HandleAttemptUnlock(const std::string& username);
...@@ -368,7 +351,6 @@ class SigninScreenHandler ...@@ -368,7 +351,6 @@ class SigninScreenHandler
void HandleCreateAccount(); void HandleCreateAccount();
void HandleAccountPickerReady(); void HandleAccountPickerReady();
void HandleWallpaperReady(); void HandleWallpaperReady();
void HandleLoginWebuiReady();
void HandleSignOutUser(); void HandleSignOutUser();
void HandleOpenProxySettings(); void HandleOpenProxySettings();
void HandleLoginVisible(const std::string& source); void HandleLoginVisible(const std::string& source);
...@@ -386,17 +368,6 @@ class SigninScreenHandler ...@@ -386,17 +368,6 @@ class SigninScreenHandler
void HandleLaunchKioskApp(const std::string& app_id, bool diagnostic_mode); void HandleLaunchKioskApp(const std::string& app_id, bool diagnostic_mode);
void HandleRetrieveAuthenticatedUserEmail(double attempt_token); void HandleRetrieveAuthenticatedUserEmail(double attempt_token);
// Kick off cookie / local storage cleanup.
void StartClearingCookies(const base::Closure& on_clear_callback);
void OnCookiesCleared(base::Closure on_clear_callback);
// Kick off DNS cache flushing.
void StartClearingDnsCache();
void OnDnsCleared();
// Decides whether an auth extension should be pre-loaded. If it should,
// pre-loads it.
void MaybePreloadAuthExtension();
// Returns true iff // Returns true iff
// (i) log in is restricted to some user list, // (i) log in is restricted to some user list,
...@@ -427,8 +398,7 @@ class SigninScreenHandler ...@@ -427,8 +398,7 @@ class SigninScreenHandler
// Returns true if offline login is allowed. // Returns true if offline login is allowed.
bool IsOfflineLoginAllowed() const; bool IsOfflineLoginAllowed() const;
// Attempts login for test. bool ShouldLoadGaia() const;
void SubmitLoginFormForTest();
// Update current input method (namely keyboard layout) to LRU by this user. // Update current input method (namely keyboard layout) to LRU by this user.
void SetUserInputMethod(const std::string& username); void SetUserInputMethod(const std::string& username);
...@@ -438,12 +408,8 @@ class SigninScreenHandler ...@@ -438,12 +408,8 @@ class SigninScreenHandler
// |state| indicates that enrollment is not applicable. // |state| indicates that enrollment is not applicable.
void ContinueKioskEnableFlow(policy::AutoEnrollmentState state); void ContinueKioskEnableFlow(policy::AutoEnrollmentState state);
// Shows signin screen for |email|. // Shows signin.
void OnShowAddUser(const std::string& email); void OnShowAddUser();
// Updates the member variable and UMA histogram indicating whether the
// principals API was used during SAML login.
void SetSAMLPrincipalsAPIUsed(bool api_used);
GaiaScreenHandler::FrameState FrameState() const; GaiaScreenHandler::FrameState FrameState() const;
net::Error FrameError() const; net::Error FrameError() const;
...@@ -466,46 +432,12 @@ class SigninScreenHandler ...@@ -466,46 +432,12 @@ class SigninScreenHandler
// Keeps whether screen should be shown for OOBE. // Keeps whether screen should be shown for OOBE.
bool oobe_ui_; bool oobe_ui_;
// 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_;
// Is account picker being shown for the first time. // Is account picker being shown for the first time.
bool is_account_picker_showing_first_time_; bool is_account_picker_showing_first_time_;
// 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_;
// Network state informer used to keep signin screen up. // Network state informer used to keep signin screen up.
scoped_refptr<NetworkStateInformer> network_state_informer_; scoped_refptr<NetworkStateInformer> network_state_informer_;
// Email to pre-populate with.
std::string email_;
// Emails of the users, whose passwords have recently been changed.
std::set<std::string> password_changed_for_;
// 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_;
base::WeakPtrFactory<SigninScreenHandler> weak_factory_;
// Set to true once |LOGIN_WEBUI_VISIBLE| notification is observed. // Set to true once |LOGIN_WEBUI_VISIBLE| notification is observed.
bool webui_visible_; bool webui_visible_;
bool preferences_changed_delayed_; bool preferences_changed_delayed_;
...@@ -541,6 +473,8 @@ class SigninScreenHandler ...@@ -541,6 +473,8 @@ class SigninScreenHandler
// Helper that retrieves the authenticated user's e-mail address. // Helper that retrieves the authenticated user's e-mail address.
scoped_ptr<AuthenticatedUserEmailRetriever> email_retriever_; scoped_ptr<AuthenticatedUserEmailRetriever> email_retriever_;
base::WeakPtrFactory<SigninScreenHandler> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(SigninScreenHandler); DISALLOW_COPY_AND_ASSIGN(SigninScreenHandler);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment