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/shell/shell_delegate_impl.h" | 5 #include "ash/shell/shell_delegate_impl.h" |
6 | 6 |
7 #include "ash/caps_lock_delegate_stub.h" | 7 #include "ash/caps_lock_delegate_stub.h" |
8 #include "ash/shell/example_factory.h" | 8 #include "ash/shell/example_factory.h" |
9 #include "ash/shell/launcher_delegate_impl.h" | 9 #include "ash/shell/launcher_delegate_impl.h" |
10 #include "ash/shell/context_menu.h" | 10 #include "ash/shell/context_menu.h" |
11 #include "ash/shell/toplevel_window.h" | 11 #include "ash/shell/toplevel_window.h" |
12 #include "ash/shell_window_ids.h" | 12 #include "ash/shell_window_ids.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 "base/message_loop.h" | 15 #include "base/message_loop.h" |
16 #include "ui/aura/window.h" | 16 #include "ui/aura/window.h" |
17 | 17 |
18 namespace ash { | 18 namespace ash { |
19 namespace shell { | 19 namespace shell { |
20 | 20 |
21 ShellDelegateImpl::ShellDelegateImpl() | 21 ShellDelegateImpl::ShellDelegateImpl() |
22 : watcher_(NULL), | 22 : watcher_(NULL), |
23 launcher_delegate_(NULL), | 23 launcher_delegate_(NULL), |
24 locked_(false), | 24 locked_(false), |
25 spoken_feedback_enabled_(false) { | 25 spoken_feedback_enabled_(false), |
| 26 high_contrast_enabled_(false), |
| 27 screen_magnifier_type_(MAGNIFIER_OFF) { |
26 } | 28 } |
27 | 29 |
28 ShellDelegateImpl::~ShellDelegateImpl() { | 30 ShellDelegateImpl::~ShellDelegateImpl() { |
29 } | 31 } |
30 | 32 |
31 void ShellDelegateImpl::SetWatcher(WindowWatcher* watcher) { | 33 void ShellDelegateImpl::SetWatcher(WindowWatcher* watcher) { |
32 watcher_ = watcher; | 34 watcher_ = watcher; |
33 if (launcher_delegate_) | 35 if (launcher_delegate_) |
34 launcher_delegate_->set_watcher(watcher); | 36 launcher_delegate_->set_watcher(watcher); |
35 } | 37 } |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 } | 117 } |
116 | 118 |
117 void ShellDelegateImpl::ToggleSpokenFeedback() { | 119 void ShellDelegateImpl::ToggleSpokenFeedback() { |
118 spoken_feedback_enabled_ = !spoken_feedback_enabled_; | 120 spoken_feedback_enabled_ = !spoken_feedback_enabled_; |
119 } | 121 } |
120 | 122 |
121 bool ShellDelegateImpl::IsSpokenFeedbackEnabled() const { | 123 bool ShellDelegateImpl::IsSpokenFeedbackEnabled() const { |
122 return spoken_feedback_enabled_; | 124 return spoken_feedback_enabled_; |
123 } | 125 } |
124 | 126 |
| 127 void ShellDelegateImpl::ToggleHighContrast() { |
| 128 high_contrast_enabled_ = !high_contrast_enabled_; |
| 129 } |
| 130 |
| 131 bool ShellDelegateImpl::IsHighContrastEnabled() const { |
| 132 return high_contrast_enabled_; |
| 133 } |
| 134 |
| 135 void ShellDelegateImpl::SetMagnifier(MagnifierType type) { |
| 136 screen_magnifier_type_ = type; |
| 137 } |
| 138 |
| 139 MagnifierType ShellDelegateImpl::GetMagnifierType() const { |
| 140 return screen_magnifier_type_; |
| 141 } |
| 142 |
| 143 bool ShellDelegateImpl::ShouldAlwaysShowAccessibilityMenu() const { |
| 144 return false; |
| 145 } |
| 146 |
125 app_list::AppListViewDelegate* ShellDelegateImpl::CreateAppListViewDelegate() { | 147 app_list::AppListViewDelegate* ShellDelegateImpl::CreateAppListViewDelegate() { |
126 return ash::shell::CreateAppListViewDelegate(); | 148 return ash::shell::CreateAppListViewDelegate(); |
127 } | 149 } |
128 | 150 |
129 ash::LauncherDelegate* ShellDelegateImpl::CreateLauncherDelegate( | 151 ash::LauncherDelegate* ShellDelegateImpl::CreateLauncherDelegate( |
130 ash::LauncherModel* model) { | 152 ash::LauncherModel* model) { |
131 launcher_delegate_ = new LauncherDelegateImpl(watcher_); | 153 launcher_delegate_ = new LauncherDelegateImpl(watcher_); |
132 return launcher_delegate_; | 154 return launcher_delegate_; |
133 } | 155 } |
134 | 156 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 aura::client::StackingClient* ShellDelegateImpl::CreateStackingClient() { | 207 aura::client::StackingClient* ShellDelegateImpl::CreateStackingClient() { |
186 return new StackingController; | 208 return new StackingController; |
187 } | 209 } |
188 | 210 |
189 bool ShellDelegateImpl::IsSearchKeyActingAsFunctionKey() const { | 211 bool ShellDelegateImpl::IsSearchKeyActingAsFunctionKey() const { |
190 return false; | 212 return false; |
191 } | 213 } |
192 | 214 |
193 } // namespace shell | 215 } // namespace shell |
194 } // namespace ash | 216 } // namespace ash |
OLD | NEW |