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

Unified Diff: ash/test/test_shell_delegate.cc

Issue 14295008: Add ash SessionStateDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ready for review. Created 7 years, 8 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: ash/test/test_shell_delegate.cc
diff --git a/ash/test/test_shell_delegate.cc b/ash/test/test_shell_delegate.cc
index ea971d7682ef0320a878dc0dd454b7ab7fd55891..8013d088b9bf3e30175adb04d3ae9b433a61c594 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

Powered by Google App Engine
This is Rietveld 408576698