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

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: Don't extend DisplayController::Observer - TouchExplorationController is owned by the root window (… 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 3690dfeaa364af590f74a4821eb7529eb36771f1..3d1a6ef1eaa8e66610044bbc96d8f46ecaabe69f 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"
@@ -730,6 +731,9 @@ void RootWindowController::Init(RootWindowType root_window_type,
// Notify shell observers about new root window.
shell->OnRootWindowAdded(root_window);
}
+
+ Shell::GetInstance()->system_tray_notifier()->AddAccessibilityObserver(this);
Daniel Erat 2014/04/18 00:44:08 remove the observer in the d'tor (probably need to
+ UpdateTouchExplorationState();
}
void RootWindowController::InitLayoutManagers() {
@@ -1019,6 +1023,26 @@ void RootWindowController::OnTouchHudProjectionToggled(bool enabled) {
DisableTouchHudProjection();
}
+void RootWindowController::UpdateTouchExplorationState() {
+ AccessibilityDelegate* delegate =
+ Shell::GetInstance()->accessibility_delegate();
Daniel Erat 2014/04/18 00:44:08 fix indenting: should be four spaces beyond previo
+ bool enabled = delegate->IsSpokenFeedbackEnabled();
+
+ LOG(ERROR) << "RWC::UpdateTouchExplorationState: enabled=" << enabled;
Daniel Erat 2014/04/18 00:44:08 remove debugging logging
+
+ if (enabled && !touch_exploration_controller_.get()) {
+ touch_exploration_controller_.reset(
+ new TouchExplorationController(GetRootWindow()));
+ } 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