diff options
Diffstat (limited to 'ash/test/test_shell_delegate.cc')
-rw-r--r-- | ash/test/test_shell_delegate.cc | 65 |
1 files changed, 15 insertions, 50 deletions
diff --git a/ash/test/test_shell_delegate.cc b/ash/test/test_shell_delegate.cc index ea971d7..8013d08 100644 --- a/ash/test/test_shell_delegate.cc +++ b/ash/test/test_shell_delegate.cc @@ -8,10 +8,13 @@ #include "ash/caps_lock_delegate_stub.h" #include "ash/host/root_window_host_factory.h" +#include "ash/session_state_delegate.h" #include "ash/shell.h" #include "ash/shell_window_ids.h" #include "ash/test/test_launcher_delegate.h" +#include "ash/test/test_session_state_delegate.h" #include "ash/wm/window_util.h" +#include "base/logging.h" #include "content/public/test/test_browser_context.h" #include "ui/aura/window.h" @@ -19,32 +22,17 @@ namespace ash { namespace test { TestShellDelegate::TestShellDelegate() - : locked_(false), - session_started_(true), - spoken_feedback_enabled_(false), + : spoken_feedback_enabled_(false), high_contrast_enabled_(false), screen_magnifier_enabled_(false), screen_magnifier_type_(kDefaultMagnifierType), - user_logged_in_(true), - can_lock_screen_(true), - num_exit_requests_(0) { + num_exit_requests_(0), + test_session_state_delegate_(NULL) { } TestShellDelegate::~TestShellDelegate() { } -bool TestShellDelegate::IsUserLoggedIn() const { - return user_logged_in_; -} - -bool TestShellDelegate::IsSessionStarted() const { - return session_started_; -} - -bool TestShellDelegate::IsGuestSession() const { - return false; -} - bool TestShellDelegate::IsFirstRunAfterBoot() const { return false; } @@ -57,22 +45,6 @@ bool TestShellDelegate::IsRunningInForcedAppMode() const { return false; } -bool TestShellDelegate::CanLockScreen() const { - return user_logged_in_ && can_lock_screen_; -} - -void TestShellDelegate::LockScreen() { - locked_ = true; -} - -void TestShellDelegate::UnlockScreen() { - locked_ = false; -} - -bool TestShellDelegate::IsScreenLocked() const { - return locked_; -} - void TestShellDelegate::PreInit() { } @@ -185,6 +157,12 @@ CapsLockDelegate* TestShellDelegate::CreateCapsLockDelegate() { return new CapsLockDelegateStub; } +SessionStateDelegate* TestShellDelegate::CreateSessionStateDelegate() { + DCHECK(!test_session_state_delegate_); + test_session_state_delegate_ = new TestSessionStateDelegate(); + return test_session_state_delegate_; +} + aura::client::UserActionClient* TestShellDelegate::CreateUserActionClient() { return NULL; } @@ -229,26 +207,13 @@ RootWindowHostFactory* TestShellDelegate::CreateRootWindowHostFactory() { return RootWindowHostFactory::Create(); } -void TestShellDelegate::SetSessionStarted(bool session_started) { - session_started_ = session_started; - if (session_started) - user_logged_in_ = true; -} - -void TestShellDelegate::SetUserLoggedIn(bool user_logged_in) { - user_logged_in_ = user_logged_in; - if (!user_logged_in) - session_started_ = false; -} - -void TestShellDelegate::SetCanLockScreen(bool can_lock_screen) { - can_lock_screen_ = can_lock_screen; -} - base::string16 TestShellDelegate::GetProductName() const { return base::string16(); } +TestSessionStateDelegate* TestShellDelegate::test_session_state_delegate() { + return test_session_state_delegate_; +} } // namespace test } // namespace ash |