Chromium Code Reviews| Index: ash/root_window_controller.cc |
| diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc |
| index 26b925c014c8f8c9669c7d060593dfa81f2aa7b0..cba5e0d54414c08798de7b4e12829c9a1aa8d70b 100644 |
| --- a/ash/root_window_controller.cc |
| +++ b/ash/root_window_controller.cc |
| @@ -76,7 +76,7 @@ |
| #include "ui/wm/public/window_types.h" |
| #if defined(OS_CHROMEOS) |
| -#include "ash/system/tray_accessibility.h" |
| +#include "ash/ash_touch_exploration_manager_chromeos.h" |
| #include "ash/wm/boot_splash_screen_chromeos.h" |
| #include "ui/chromeos/touch_exploration_controller.h" |
| #endif |
| @@ -261,54 +261,6 @@ class EmptyWindowDelegate : public aura::WindowDelegate { |
| DISALLOW_COPY_AND_ASSIGN(EmptyWindowDelegate); |
| }; |
| -#if defined(OS_CHROMEOS) |
| -// Responsible for initializing TouchExplorationController when spoken |
| -// feedback is on. |
| -class CrosAccessibilityObserver : public AccessibilityObserver { |
| - public: |
| - explicit CrosAccessibilityObserver( |
| - RootWindowController* root_window_controller) |
| - : root_window_controller_(root_window_controller) { |
| - Shell::GetInstance()->system_tray_notifier()-> |
| - AddAccessibilityObserver(this); |
| - UpdateTouchExplorationState(); |
| - } |
| - |
| - virtual ~CrosAccessibilityObserver() { |
| - SystemTrayNotifier* system_tray_notifier = |
| - Shell::GetInstance()->system_tray_notifier(); |
| - if (system_tray_notifier) |
| - system_tray_notifier->RemoveAccessibilityObserver(this); |
| - } |
| - |
| - private: |
| - void UpdateTouchExplorationState() { |
| - AccessibilityDelegate* delegate = |
| - Shell::GetInstance()->accessibility_delegate(); |
| - bool enabled = delegate->IsSpokenFeedbackEnabled(); |
| - |
| - if (enabled && !touch_exploration_controller_.get()) { |
| - touch_exploration_controller_.reset( |
| - new ui::TouchExplorationController( |
| - root_window_controller_->GetRootWindow())); |
| - } else if (!enabled) { |
| - touch_exploration_controller_.reset(); |
| - } |
| - } |
| - |
| - // Overridden from AccessibilityObserver. |
| - virtual void OnAccessibilityModeChanged( |
| - AccessibilityNotificationVisibility notify) OVERRIDE { |
| - UpdateTouchExplorationState(); |
| - } |
| - |
| - scoped_ptr<ui::TouchExplorationController> touch_exploration_controller_; |
| - RootWindowController* root_window_controller_; |
| - |
| - DISALLOW_COPY_AND_ASSIGN(CrosAccessibilityObserver); |
| -}; |
| -#endif // OS_CHROMEOS |
| - |
| } // namespace |
| void RootWindowController::CreateForPrimaryDisplay(AshWindowTreeHost* host) { |
| @@ -396,8 +348,9 @@ void RootWindowController::Shutdown() { |
| shell->RemoveShellObserver(this); |
| #if defined(OS_CHROMEOS) |
| - if (cros_accessibility_observer_) { |
| - cros_accessibility_observer_.reset(); |
| + if (touch_exploration_manager_) { |
| + VLOG(0) << "Removed Touch Exploration"; |
|
James Cook
2014/07/21 21:05:35
Remove this line
lisayin
2014/07/22 16:22:46
Done.
|
| + touch_exploration_manager_.reset(); |
| } |
| #endif |
| @@ -807,7 +760,8 @@ void RootWindowController::Init(RootWindowType root_window_type, |
| #if defined(OS_CHROMEOS) |
| if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| switches::kAshDisableTouchExplorationMode)) { |
| - cros_accessibility_observer_.reset(new CrosAccessibilityObserver(this)); |
| + VLOG(0) << "New touch exploration manager"; |
| + touch_exploration_manager_.reset(new AshTouchExplorationManager(this)); |
| } |
| #endif |
| } |