summaryrefslogtreecommitdiffstats
path: root/ash/root_window_controller.cc
diff options
context:
space:
mode:
authorlisayin@chromium.org <lisayin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-24 03:54:50 +0000
committerlisayin@chromium.org <lisayin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-24 03:54:50 +0000
commit7d487599ccaf2cd62ddd4049319db6ff941c6968 (patch)
tree83487393b6ff94f9a596b85e92f3baa614417d8b /ash/root_window_controller.cc
parent518c63a8259a75d4c18b94ef9348bd5c08a88833 (diff)
downloadchromium_src-7d487599ccaf2cd62ddd4049319db6ff941c6968.zip
chromium_src-7d487599ccaf2cd62ddd4049319db6ff941c6968.tar.gz
chromium_src-7d487599ccaf2cd62ddd4049319db6ff941c6968.tar.bz2
Added side slide gestures to touch exploration controller.
The user can control settings that might be normally changed using sliders by sliding along the edge of the screen when ChromeVox is on. For example, the user can slide along the right edge of the screen and adjust the volume. If the user enters this mode and leaves the boundaries without releasing their touch, they will stop adjusting the setting, however, they will not enter touch exploration. If they return to the given boundaries, they will be able to modify the setting again. If the user does not touch a "hot edge" of the screen, they will not enter this state if they move to the an of the screen. BUG=393326 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=284819 Review URL: https://codereview.chromium.org/385073009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285149 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/root_window_controller.cc')
-rw-r--r--ash/root_window_controller.cc56
1 files changed, 4 insertions, 52 deletions
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index 26b925c0..0e07dbe 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,8 @@ void RootWindowController::Shutdown() {
shell->RemoveShellObserver(this);
#if defined(OS_CHROMEOS)
- if (cros_accessibility_observer_) {
- cros_accessibility_observer_.reset();
+ if (touch_exploration_manager_) {
+ touch_exploration_manager_.reset();
}
#endif
@@ -807,7 +759,7 @@ void RootWindowController::Init(RootWindowType root_window_type,
#if defined(OS_CHROMEOS)
if (!CommandLine::ForCurrentProcess()->HasSwitch(
switches::kAshDisableTouchExplorationMode)) {
- cros_accessibility_observer_.reset(new CrosAccessibilityObserver(this));
+ touch_exploration_manager_.reset(new AshTouchExplorationManager(this));
}
#endif
}