| 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 num_exit_requests_(0) { | 29 num_exit_requests_(0) { |
| 28 } | 30 } |
| 29 | 31 |
| 30 TestShellDelegate::~TestShellDelegate() { | 32 TestShellDelegate::~TestShellDelegate() { |
| 31 } | 33 } |
| 32 | 34 |
| 33 bool TestShellDelegate::IsUserLoggedIn() { | 35 bool TestShellDelegate::IsUserLoggedIn() { |
| 34 return user_logged_in_; | 36 return user_logged_in_; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 } | 107 } |
| 106 | 108 |
| 107 void TestShellDelegate::ToggleSpokenFeedback() { | 109 void TestShellDelegate::ToggleSpokenFeedback() { |
| 108 spoken_feedback_enabled_ = !spoken_feedback_enabled_; | 110 spoken_feedback_enabled_ = !spoken_feedback_enabled_; |
| 109 } | 111 } |
| 110 | 112 |
| 111 bool TestShellDelegate::IsSpokenFeedbackEnabled() const { | 113 bool TestShellDelegate::IsSpokenFeedbackEnabled() const { |
| 112 return spoken_feedback_enabled_; | 114 return spoken_feedback_enabled_; |
| 113 } | 115 } |
| 114 | 116 |
| 117 void TestShellDelegate::ToggleHighContrast() { |
| 118 high_contrast_enabled_ = !high_contrast_enabled_; |
| 119 } |
| 120 |
| 121 bool TestShellDelegate::IsHighContrastEnabled() const { |
| 122 return high_contrast_enabled_; |
| 123 } |
| 124 |
| 125 void TestShellDelegate::SetScreenMagnifier(const MagnifierType type) { |
| 126 screen_magnifier_type_ = type; |
| 127 } |
| 128 |
| 129 MagnifierType TestShellDelegate::GetMagnifierType() const { |
| 130 return screen_magnifier_type_; |
| 131 } |
| 132 |
| 133 bool TestShellDelegate::ShouldAlwaysShowAccessibilityMenu() const { |
| 134 return false; |
| 135 } |
| 136 |
| 115 app_list::AppListViewDelegate* TestShellDelegate::CreateAppListViewDelegate() { | 137 app_list::AppListViewDelegate* TestShellDelegate::CreateAppListViewDelegate() { |
| 116 return NULL; | 138 return NULL; |
| 117 } | 139 } |
| 118 | 140 |
| 119 LauncherDelegate* TestShellDelegate::CreateLauncherDelegate( | 141 LauncherDelegate* TestShellDelegate::CreateLauncherDelegate( |
| 120 ash::LauncherModel* model) { | 142 ash::LauncherModel* model) { |
| 121 return new TestLauncherDelegate(model); | 143 return new TestLauncherDelegate(model); |
| 122 } | 144 } |
| 123 | 145 |
| 124 SystemTrayDelegate* TestShellDelegate::CreateSystemTrayDelegate() { | 146 SystemTrayDelegate* TestShellDelegate::CreateSystemTrayDelegate() { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 if (!user_logged_in) | 204 if (!user_logged_in) |
| 183 session_started_ = false; | 205 session_started_ = false; |
| 184 } | 206 } |
| 185 | 207 |
| 186 void TestShellDelegate::SetCanLockScreen(bool can_lock_screen) { | 208 void TestShellDelegate::SetCanLockScreen(bool can_lock_screen) { |
| 187 can_lock_screen_ = can_lock_screen; | 209 can_lock_screen_ = can_lock_screen; |
| 188 } | 210 } |
| 189 | 211 |
| 190 } // namespace test | 212 } // namespace test |
| 191 } // namespace ash | 213 } // namespace ash |
| OLD | NEW |