Index: ash/root_window_controller.cc |
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc |
index caa1228890e223325fdbf44c9f3b658fbb2d0b0d..8774ec637555562bb54ec82211171aa61e2054ba 100644 |
--- a/ash/root_window_controller.cc |
+++ b/ash/root_window_controller.cc |
@@ -27,6 +27,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" |
@@ -713,6 +714,9 @@ void RootWindowController::Init(RootWindowType root_window_type, |
if (shell->session_state_delegate()->NumberOfLoggedInUsers()) |
shelf()->CreateShelf(); |
} |
+ |
+ Shell::GetInstance()->system_tray_notifier()->AddAccessibilityObserver(this); |
+ UpdateTouchExplorationState(); |
} |
void RootWindowController::InitLayoutManagers() { |
@@ -1009,6 +1013,26 @@ void RootWindowController::OnTouchHudProjectionToggled(bool enabled) { |
DisableTouchHudProjection(); |
} |
+void RootWindowController::UpdateTouchExplorationState() { |
+ AccessibilityDelegate* delegate = |
+ Shell::GetInstance()->accessibility_delegate(); |
+ bool enabled = delegate->IsSpokenFeedbackEnabled(); |
+ |
+ LOG(ERROR) << "RWC::UpdateTouchExplorationState: enabled=" << enabled; |
+ |
+ if (enabled && !touch_exploration_controller_.get()) { |
+ touch_exploration_controller_.reset( |
+ new TouchExplorationController(root_window())); |
+ } 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; |