Chromium Code Reviews| Index: ash/root_window_controller.cc |
| diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc |
| index 3690dfeaa364af590f74a4821eb7529eb36771f1..3d1a6ef1eaa8e66610044bbc96d8f46ecaabe69f 100644 |
| --- a/ash/root_window_controller.cc |
| +++ b/ash/root_window_controller.cc |
| @@ -28,6 +28,7 @@ |
| #include "ash/switchable_windows.h" |
| #include "ash/system/status_area_widget.h" |
| #include "ash/system/tray/system_tray_delegate.h" |
| +#include "ash/system/tray/system_tray_notifier.h" |
| #include "ash/touch/touch_hud_debug.h" |
| #include "ash/touch/touch_hud_projection.h" |
| #include "ash/touch/touch_observer_hud.h" |
| @@ -730,6 +731,9 @@ void RootWindowController::Init(RootWindowType root_window_type, |
| // Notify shell observers about new root window. |
| shell->OnRootWindowAdded(root_window); |
| } |
| + |
| + Shell::GetInstance()->system_tray_notifier()->AddAccessibilityObserver(this); |
|
Daniel Erat
2014/04/18 00:44:08
remove the observer in the d'tor (probably need to
|
| + UpdateTouchExplorationState(); |
| } |
| void RootWindowController::InitLayoutManagers() { |
| @@ -1019,6 +1023,26 @@ void RootWindowController::OnTouchHudProjectionToggled(bool enabled) { |
| DisableTouchHudProjection(); |
| } |
| +void RootWindowController::UpdateTouchExplorationState() { |
| + AccessibilityDelegate* delegate = |
| + Shell::GetInstance()->accessibility_delegate(); |
|
Daniel Erat
2014/04/18 00:44:08
fix indenting: should be four spaces beyond previo
|
| + bool enabled = delegate->IsSpokenFeedbackEnabled(); |
| + |
| + LOG(ERROR) << "RWC::UpdateTouchExplorationState: enabled=" << enabled; |
|
Daniel Erat
2014/04/18 00:44:08
remove debugging logging
|
| + |
| + if (enabled && !touch_exploration_controller_.get()) { |
| + touch_exploration_controller_.reset( |
| + new TouchExplorationController(GetRootWindow())); |
| + } else if (!enabled && touch_exploration_controller_.get()) { |
| + touch_exploration_controller_.reset(); |
| + } |
| +} |
| + |
| +void RootWindowController::OnAccessibilityModeChanged( |
| + AccessibilityNotificationVisibility notify) { |
| + UpdateTouchExplorationState(); |
| +} |
| + |
| RootWindowController* GetRootWindowController( |
| const aura::Window* root_window) { |
| return root_window ? GetRootWindowSettings(root_window)->controller : NULL; |