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/root_window_controller.h" | 5 #include "ash/root_window_controller.h" |
6 | 6 |
7 #include <queue> | 7 #include <queue> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/ash_constants.h" | 10 #include "ash/ash_constants.h" |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 UpdateTouchExplorationState(); | 274 UpdateTouchExplorationState(); |
275 } | 275 } |
276 | 276 |
277 virtual ~CrosAccessibilityObserver() { | 277 virtual ~CrosAccessibilityObserver() { |
278 SystemTrayNotifier* system_tray_notifier = | 278 SystemTrayNotifier* system_tray_notifier = |
279 Shell::GetInstance()->system_tray_notifier(); | 279 Shell::GetInstance()->system_tray_notifier(); |
280 if (system_tray_notifier) | 280 if (system_tray_notifier) |
281 system_tray_notifier->RemoveAccessibilityObserver(this); | 281 system_tray_notifier->RemoveAccessibilityObserver(this); |
282 } | 282 } |
283 | 283 |
| 284 ui::TouchExplorationController* GetTouchExplorationController() { |
| 285 return touch_exploration_controller_.get(); |
| 286 } |
| 287 |
284 private: | 288 private: |
285 void UpdateTouchExplorationState() { | 289 void UpdateTouchExplorationState() { |
286 AccessibilityDelegate* delegate = | 290 AccessibilityDelegate* delegate = |
287 Shell::GetInstance()->accessibility_delegate(); | 291 Shell::GetInstance()->accessibility_delegate(); |
288 bool enabled = delegate->IsSpokenFeedbackEnabled(); | 292 bool enabled = delegate->IsSpokenFeedbackEnabled(); |
289 | |
290 if (enabled && !touch_exploration_controller_.get()) { | 293 if (enabled && !touch_exploration_controller_.get()) { |
291 touch_exploration_controller_.reset( | 294 touch_exploration_controller_.reset(new ui::TouchExplorationController( |
292 new ui::TouchExplorationController( | 295 root_window_controller_->GetRootWindow())); |
293 root_window_controller_->GetRootWindow())); | |
294 } else if (!enabled) { | 296 } else if (!enabled) { |
295 touch_exploration_controller_.reset(); | 297 touch_exploration_controller_.reset(); |
296 } | 298 } |
297 } | 299 } |
298 | 300 |
299 // Overridden from AccessibilityObserver. | 301 // Overridden from AccessibilityObserver. |
300 virtual void OnAccessibilityModeChanged( | 302 virtual void OnAccessibilityModeChanged( |
301 AccessibilityNotificationVisibility notify) OVERRIDE { | 303 AccessibilityNotificationVisibility notify) OVERRIDE { |
302 UpdateTouchExplorationState(); | 304 UpdateTouchExplorationState(); |
303 } | 305 } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 } | 374 } |
373 | 375 |
374 aura::Window* RootWindowController::GetRootWindow() { | 376 aura::Window* RootWindowController::GetRootWindow() { |
375 return GetHost()->window(); | 377 return GetHost()->window(); |
376 } | 378 } |
377 | 379 |
378 const aura::Window* RootWindowController::GetRootWindow() const { | 380 const aura::Window* RootWindowController::GetRootWindow() const { |
379 return GetHost()->window(); | 381 return GetHost()->window(); |
380 } | 382 } |
381 | 383 |
| 384 ui::TouchExplorationController* |
| 385 RootWindowController::GetTouchExplorationController() { |
| 386 return static_cast<CrosAccessibilityObserver*>( |
| 387 cros_accessibility_observer_.get()) |
| 388 ->GetTouchExplorationController(); |
| 389 } |
| 390 |
382 void RootWindowController::SetWallpaperController( | 391 void RootWindowController::SetWallpaperController( |
383 DesktopBackgroundWidgetController* controller) { | 392 DesktopBackgroundWidgetController* controller) { |
384 wallpaper_controller_.reset(controller); | 393 wallpaper_controller_.reset(controller); |
385 } | 394 } |
386 | 395 |
387 void RootWindowController::SetAnimatingWallpaperController( | 396 void RootWindowController::SetAnimatingWallpaperController( |
388 AnimatingDesktopController* controller) { | 397 AnimatingDesktopController* controller) { |
389 if (animating_wallpaper_controller_.get()) | 398 if (animating_wallpaper_controller_.get()) |
390 animating_wallpaper_controller_->StopAnimating(); | 399 animating_wallpaper_controller_->StopAnimating(); |
391 animating_wallpaper_controller_.reset(controller); | 400 animating_wallpaper_controller_.reset(controller); |
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1111 else | 1120 else |
1112 DisableTouchHudProjection(); | 1121 DisableTouchHudProjection(); |
1113 } | 1122 } |
1114 | 1123 |
1115 RootWindowController* GetRootWindowController( | 1124 RootWindowController* GetRootWindowController( |
1116 const aura::Window* root_window) { | 1125 const aura::Window* root_window) { |
1117 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; | 1126 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; |
1118 } | 1127 } |
1119 | 1128 |
1120 } // namespace ash | 1129 } // namespace ash |
OLD | NEW |