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

Unified Diff: ash/root_window_controller.cc

Issue 225143007: First crack at implementing the touch explaration mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor changes 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
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;

Powered by Google App Engine
This is Rietveld 408576698