| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/test/test_shell_delegate.h" | 5 #include "ash/test/test_shell_delegate.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/caps_lock_delegate_stub.h" | 9 #include "ash/caps_lock_delegate_stub.h" |
| 10 #include "ash/host/root_window_host_factory.h" | 10 #include "ash/host/root_window_host_factory.h" |
| 11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 12 #include "ash/shell_window_ids.h" | 12 #include "ash/shell_window_ids.h" |
| 13 #include "ash/test/test_launcher_delegate.h" | 13 #include "ash/test/test_launcher_delegate.h" |
| 14 #include "ash/wm/stacking_controller.h" | 14 #include "ash/wm/stacking_controller.h" |
| 15 #include "ash/wm/window_util.h" | 15 #include "ash/wm/window_util.h" |
| 16 #include "content/public/test/test_browser_context.h" | 16 #include "content/public/test/test_browser_context.h" |
| 17 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
| 18 | 18 |
| 19 namespace ash { | 19 namespace ash { |
| 20 namespace test { | 20 namespace test { |
| 21 | 21 |
| 22 TestShellDelegate::TestShellDelegate() | 22 TestShellDelegate::TestShellDelegate() |
| 23 : locked_(false), | 23 : locked_(false), |
| 24 session_started_(true), | 24 session_started_(true), |
| 25 spoken_feedback_enabled_(false), | 25 spoken_feedback_enabled_(false), |
| 26 high_contrast_enabled_(false), | 26 high_contrast_enabled_(false), |
| 27 screen_magnifier_type_(MAGNIFIER_OFF), | 27 screen_magnifier_type_(MAGNIFIER_OFF), |
| 28 user_logged_in_(true), | 28 user_logged_in_(true), |
| 29 can_lock_screen_(true), | 29 can_lock_screen_(true), |
| 30 is_search_key_acting_as_function_key_(false), | |
| 31 num_exit_requests_(0) { | 30 num_exit_requests_(0) { |
| 32 } | 31 } |
| 33 | 32 |
| 34 TestShellDelegate::~TestShellDelegate() { | 33 TestShellDelegate::~TestShellDelegate() { |
| 35 } | 34 } |
| 36 | 35 |
| 37 bool TestShellDelegate::IsUserLoggedIn() const { | 36 bool TestShellDelegate::IsUserLoggedIn() const { |
| 38 return user_logged_in_; | 37 return user_logged_in_; |
| 39 } | 38 } |
| 40 | 39 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 } | 192 } |
| 194 | 193 |
| 195 double TestShellDelegate::GetSavedScreenMagnifierScale() { | 194 double TestShellDelegate::GetSavedScreenMagnifierScale() { |
| 196 return std::numeric_limits<double>::min(); | 195 return std::numeric_limits<double>::min(); |
| 197 } | 196 } |
| 198 | 197 |
| 199 aura::client::StackingClient* TestShellDelegate::CreateStackingClient() { | 198 aura::client::StackingClient* TestShellDelegate::CreateStackingClient() { |
| 200 return new StackingController; | 199 return new StackingController; |
| 201 } | 200 } |
| 202 | 201 |
| 203 bool TestShellDelegate::IsSearchKeyActingAsFunctionKey() const { | |
| 204 return is_search_key_acting_as_function_key_; | |
| 205 } | |
| 206 | |
| 207 RootWindowHostFactory* TestShellDelegate::CreateRootWindowHostFactory() { | 202 RootWindowHostFactory* TestShellDelegate::CreateRootWindowHostFactory() { |
| 208 return RootWindowHostFactory::Create(); | 203 return RootWindowHostFactory::Create(); |
| 209 } | 204 } |
| 210 | 205 |
| 211 void TestShellDelegate::SetSessionStarted(bool session_started) { | 206 void TestShellDelegate::SetSessionStarted(bool session_started) { |
| 212 session_started_ = session_started; | 207 session_started_ = session_started; |
| 213 if (session_started) | 208 if (session_started) |
| 214 user_logged_in_ = true; | 209 user_logged_in_ = true; |
| 215 } | 210 } |
| 216 | 211 |
| 217 void TestShellDelegate::SetUserLoggedIn(bool user_logged_in) { | 212 void TestShellDelegate::SetUserLoggedIn(bool user_logged_in) { |
| 218 user_logged_in_ = user_logged_in; | 213 user_logged_in_ = user_logged_in; |
| 219 if (!user_logged_in) | 214 if (!user_logged_in) |
| 220 session_started_ = false; | 215 session_started_ = false; |
| 221 } | 216 } |
| 222 | 217 |
| 223 void TestShellDelegate::SetCanLockScreen(bool can_lock_screen) { | 218 void TestShellDelegate::SetCanLockScreen(bool can_lock_screen) { |
| 224 can_lock_screen_ = can_lock_screen; | 219 can_lock_screen_ = can_lock_screen; |
| 225 } | 220 } |
| 226 | 221 |
| 227 } // namespace test | 222 } // namespace test |
| 228 } // namespace ash | 223 } // namespace ash |
| OLD | NEW |