diff options
author | bartfab@google.com <bartfab@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-17 12:21:57 +0000 |
---|---|---|
committer | bartfab@google.com <bartfab@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-17 12:21:57 +0000 |
commit | 5b5495c70de838b40cc9e5990140fd9b2ad16987 (patch) | |
tree | b5b02aa5e8392edd79a275ffc613c0241e396414 /ash/test/test_shell_delegate.h | |
parent | bac6ffd0f853d003e235a29d51f138ec4d70f034 (diff) | |
download | chromium_src-5b5495c70de838b40cc9e5990140fd9b2ad16987.zip chromium_src-5b5495c70de838b40cc9e5990140fd9b2ad16987.tar.gz chromium_src-5b5495c70de838b40cc9e5990140fd9b2ad16987.tar.bz2 |
Add ash SessionStateDelegate
This CL refactors the ShellDelegate by adding a SessionStateDelegate to
which methods dealing with the session state can be moved. This cleans up
the huge ShellDelegate interface and paves the way for further Chrome OS
multiprofile work which will need to add several new methods related to
the session state.
This CL is only the first step. Several other methods should also move to
SessionStateDelegate but I do not want to overburden a single CL.
BUG=None
TEST=Manual and browser/unit tests
TBR=sky (for c/b/idle_chromeos.cc and c/chrome_browser_ui.gypi)
Review URL: https://codereview.chromium.org/14295008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194578 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/test/test_shell_delegate.h')
-rw-r--r-- | ash/test/test_shell_delegate.h | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/ash/test/test_shell_delegate.h b/ash/test/test_shell_delegate.h index 1ff9ce9..6c95ea8 100644 --- a/ash/test/test_shell_delegate.h +++ b/ash/test/test_shell_delegate.h @@ -18,7 +18,7 @@ class KeyboardControllerProxy; namespace ash { namespace test { -class AshTestBase; +class TestSessionStateDelegate; class TestShellDelegate : public ShellDelegate { public: @@ -26,16 +26,9 @@ class TestShellDelegate : public ShellDelegate { virtual ~TestShellDelegate(); // Overridden from ShellDelegate: - virtual bool IsUserLoggedIn() const OVERRIDE; - virtual bool IsSessionStarted() const OVERRIDE; - virtual bool IsGuestSession() const OVERRIDE; virtual bool IsFirstRunAfterBoot() const OVERRIDE; virtual bool IsMultiProfilesEnabled() const OVERRIDE; virtual bool IsRunningInForcedAppMode() const OVERRIDE; - virtual bool CanLockScreen() const OVERRIDE; - virtual void LockScreen() OVERRIDE; - virtual void UnlockScreen() OVERRIDE; - virtual bool IsScreenLocked() const OVERRIDE; virtual void PreInit() OVERRIDE; virtual void Shutdown() OVERRIDE; virtual void Exit() OVERRIDE; @@ -68,6 +61,7 @@ class TestShellDelegate : public ShellDelegate { virtual SystemTrayDelegate* CreateSystemTrayDelegate() OVERRIDE; virtual UserWallpaperDelegate* CreateUserWallpaperDelegate() OVERRIDE; virtual CapsLockDelegate* CreateCapsLockDelegate() OVERRIDE; + virtual SessionStateDelegate* CreateSessionStateDelegate() OVERRIDE; virtual aura::client::UserActionClient* CreateUserActionClient() OVERRIDE; virtual void OpenFeedbackPage() OVERRIDE; virtual void RecordUserMetricsAction(UserMetricsAction action) OVERRIDE; @@ -85,39 +79,19 @@ class TestShellDelegate : public ShellDelegate { int num_exit_requests() const { return num_exit_requests_; } + TestSessionStateDelegate* test_session_state_delegate(); + private: - friend class ash::test::AshTestBase; - - // Given |session_started| will update internal state. - // If |session_started| is true this method will also set - // |user_logged_in_| to true. - // When session is started it always means that user has logged in. - // Possible situation is that user has already logged in but session has not - // been started (user selects avatar and login window is still open). - void SetSessionStarted(bool session_started); - - // Given |user_logged_in| will update internal state. - // If |user_logged_in| is false this method will also set |session_started_| - // to false. When user is not logged in it always means that session - // hasn't been started too. - void SetUserLoggedIn(bool user_logged_in); - - // Sets the internal state that indicates whether the user can lock the - // screen. - void SetCanLockScreen(bool can_lock_screen); - - bool locked_; - bool session_started_; bool spoken_feedback_enabled_; bool high_contrast_enabled_; bool screen_magnifier_enabled_; MagnifierType screen_magnifier_type_; - bool user_logged_in_; - bool can_lock_screen_; int num_exit_requests_; scoped_ptr<content::BrowserContext> current_browser_context_; + TestSessionStateDelegate* test_session_state_delegate_; // Not owned. + DISALLOW_COPY_AND_ASSIGN(TestShellDelegate); }; |