Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2120)

Unified Diff: ash/root_window_controller.cc

Issue 240333007: wip: Second crack at implementing the touch exploration mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding a flag to disable the touch exploration mode. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/root_window_controller.h ('k') | ash/test/root_window_controller_test_api_chromeos.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/root_window_controller.cc
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index ba38e14a8db5b5697712a03377f0032dde2cc1ca..9b807e005476ca998e999171d0b199e13392b556 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"
@@ -75,6 +76,7 @@
#if defined(OS_CHROMEOS)
#include "ash/wm/boot_splash_screen_chromeos.h"
+#include "ui/chromeos/touch_exploration_controller.h"
#endif
namespace ash {
@@ -339,7 +341,17 @@ void RootWindowController::SetAnimatingWallpaperController(
}
void RootWindowController::Shutdown() {
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell* shell = Shell::GetInstance();
+ shell->RemoveShellObserver(this);
+
+#if defined(OS_CHROMEOS)
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kAshDisableTouchExplorationMode)) {
+ if (shell->system_tray_notifier())
+ shell->system_tray_notifier()->RemoveAccessibilityObserver(this);
+ touch_exploration_controller_.reset();
+ }
+#endif
if (animating_wallpaper_controller_.get())
animating_wallpaper_controller_->StopAnimating();
@@ -351,7 +363,7 @@ void RootWindowController::Shutdown() {
// window list adding windows from the target root window's containers which
// may have already gone away.
if (Shell::GetTargetRootWindow() == root_window) {
- Shell::GetInstance()->set_target_root_window(
+ shell->set_target_root_window(
Shell::GetPrimaryRootWindow() == root_window
? NULL
: Shell::GetPrimaryRootWindow());
@@ -736,6 +748,15 @@ void RootWindowController::Init(RootWindowType root_window_type,
// Notify shell observers about new root window.
shell->OnRootWindowAdded(root_window);
}
+
+#if defined(OS_CHROMEOS)
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kAshDisableTouchExplorationMode)) {
+ Shell::GetInstance()->system_tray_notifier()->
+ AddAccessibilityObserver(this);
+ UpdateTouchExplorationState();
+ }
+#endif
}
void RootWindowController::InitLayoutManagers() {
@@ -1008,6 +1029,21 @@ void RootWindowController::CreateContainersInRootWindow(
"PowerButtonAnimationContainer", root_window);
}
+#if defined(OS_CHROMEOS)
+void RootWindowController::UpdateTouchExplorationState() {
+ AccessibilityDelegate* delegate =
+ Shell::GetInstance()->accessibility_delegate();
+ bool enabled = delegate->IsSpokenFeedbackEnabled();
+
+ if (enabled && !touch_exploration_controller_.get()) {
+ touch_exploration_controller_.reset(
+ new ui::TouchExplorationController(GetRootWindow()));
+ } else if (!enabled && touch_exploration_controller_.get()) {
+ touch_exploration_controller_.reset();
+ }
+}
+#endif
+
void RootWindowController::EnableTouchHudProjection() {
if (touch_hud_projection_)
return;
@@ -1031,6 +1067,16 @@ void RootWindowController::OnTouchHudProjectionToggled(bool enabled) {
DisableTouchHudProjection();
}
+#if defined(OS_CHROMEOS)
+void RootWindowController::OnAccessibilityModeChanged(
+ AccessibilityNotificationVisibility notify) {
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kAshDisableTouchExplorationMode)) {
+ UpdateTouchExplorationState();
+ }
+}
+#endif
+
RootWindowController* GetRootWindowController(
const aura::Window* root_window) {
return root_window ? GetRootWindowSettings(root_window)->controller : NULL;
« no previous file with comments | « ash/root_window_controller.h ('k') | ash/test/root_window_controller_test_api_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698