| 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/shell.h" | 10 #include "ash/shell.h" |
| 11 #include "ash/shell_window_ids.h" | 11 #include "ash/shell_window_ids.h" |
| 12 #include "ash/test/test_launcher_delegate.h" | 12 #include "ash/test/test_launcher_delegate.h" |
| 13 #include "ash/wm/stacking_controller.h" | 13 #include "ash/wm/stacking_controller.h" |
| 14 #include "ash/wm/window_util.h" | 14 #include "ash/wm/window_util.h" |
| 15 #include "content/public/test/test_browser_context.h" | 15 #include "content/public/test/test_browser_context.h" |
| 16 #include "ui/aura/window.h" | 16 #include "ui/aura/window.h" |
| 17 | 17 |
| 18 namespace ash { | 18 namespace ash { |
| 19 namespace test { | 19 namespace test { |
| 20 | 20 |
| 21 TestShellDelegate::TestShellDelegate() | 21 TestShellDelegate::TestShellDelegate() |
| 22 : locked_(false), | 22 : locked_(false), |
| 23 session_started_(true), | 23 session_started_(true), |
| 24 spoken_feedback_enabled_(false), | 24 spoken_feedback_enabled_(false), |
| 25 high_contrast_enabled_(false), |
| 26 screen_magnifier_type_(MAGNIFIER_OFF), |
| 25 user_logged_in_(true), | 27 user_logged_in_(true), |
| 26 can_lock_screen_(true), | 28 can_lock_screen_(true), |
| 27 is_search_key_acting_as_function_key_(false), | 29 is_search_key_acting_as_function_key_(false), |
| 28 num_exit_requests_(0) { | 30 num_exit_requests_(0) { |
| 29 } | 31 } |
| 30 | 32 |
| 31 TestShellDelegate::~TestShellDelegate() { | 33 TestShellDelegate::~TestShellDelegate() { |
| 32 } | 34 } |
| 33 | 35 |
| 34 bool TestShellDelegate::IsUserLoggedIn() { | 36 bool TestShellDelegate::IsUserLoggedIn() { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 } | 108 } |
| 107 | 109 |
| 108 void TestShellDelegate::ToggleSpokenFeedback() { | 110 void TestShellDelegate::ToggleSpokenFeedback() { |
| 109 spoken_feedback_enabled_ = !spoken_feedback_enabled_; | 111 spoken_feedback_enabled_ = !spoken_feedback_enabled_; |
| 110 } | 112 } |
| 111 | 113 |
| 112 bool TestShellDelegate::IsSpokenFeedbackEnabled() const { | 114 bool TestShellDelegate::IsSpokenFeedbackEnabled() const { |
| 113 return spoken_feedback_enabled_; | 115 return spoken_feedback_enabled_; |
| 114 } | 116 } |
| 115 | 117 |
| 118 void TestShellDelegate::ToggleHighContrast() { |
| 119 high_contrast_enabled_ = !high_contrast_enabled_; |
| 120 } |
| 121 |
| 122 bool TestShellDelegate::IsHighContrastEnabled() const { |
| 123 return high_contrast_enabled_; |
| 124 } |
| 125 |
| 126 void TestShellDelegate::SetMagnifier(const MagnifierType type) { |
| 127 screen_magnifier_type_ = type; |
| 128 } |
| 129 |
| 130 MagnifierType TestShellDelegate::GetMagnifierType() const { |
| 131 return screen_magnifier_type_; |
| 132 } |
| 133 |
| 134 bool TestShellDelegate::ShouldAlwaysShowAccessibilityMenu() const { |
| 135 return false; |
| 136 } |
| 137 |
| 116 app_list::AppListViewDelegate* TestShellDelegate::CreateAppListViewDelegate() { | 138 app_list::AppListViewDelegate* TestShellDelegate::CreateAppListViewDelegate() { |
| 117 return NULL; | 139 return NULL; |
| 118 } | 140 } |
| 119 | 141 |
| 120 LauncherDelegate* TestShellDelegate::CreateLauncherDelegate( | 142 LauncherDelegate* TestShellDelegate::CreateLauncherDelegate( |
| 121 ash::LauncherModel* model) { | 143 ash::LauncherModel* model) { |
| 122 return new TestLauncherDelegate(model); | 144 return new TestLauncherDelegate(model); |
| 123 } | 145 } |
| 124 | 146 |
| 125 SystemTrayDelegate* TestShellDelegate::CreateSystemTrayDelegate() { | 147 SystemTrayDelegate* TestShellDelegate::CreateSystemTrayDelegate() { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 if (!user_logged_in) | 213 if (!user_logged_in) |
| 192 session_started_ = false; | 214 session_started_ = false; |
| 193 } | 215 } |
| 194 | 216 |
| 195 void TestShellDelegate::SetCanLockScreen(bool can_lock_screen) { | 217 void TestShellDelegate::SetCanLockScreen(bool can_lock_screen) { |
| 196 can_lock_screen_ = can_lock_screen; | 218 can_lock_screen_ = can_lock_screen; |
| 197 } | 219 } |
| 198 | 220 |
| 199 } // namespace test | 221 } // namespace test |
| 200 } // namespace ash | 222 } // namespace ash |
| OLD | NEW |