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

Side by Side Diff: ash/ash_touch_exploration_manager_chromeos.cc

Issue 2746543004: Enable native accessible touch support inside of ARC (Closed)
Patch Set: Address nit. Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « ash/ash_touch_exploration_manager_chromeos.h ('k') | components/exo/pointer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/ash_touch_exploration_manager_chromeos.h" 5 #include "ash/ash_touch_exploration_manager_chromeos.h"
6 6
7 #include "ash/common/accessibility_delegate.h" 7 #include "ash/common/accessibility_delegate.h"
8 #include "ash/common/system/tray/system_tray_notifier.h" 8 #include "ash/common/system/tray/system_tray_notifier.h"
9 #include "ash/common/wm_shell.h" 9 #include "ash/common/wm_shell.h"
10 #include "ash/common/wm_window.h" 10 #include "ash/common/wm_window.h"
11 #include "ash/root_window_controller.h" 11 #include "ash/root_window_controller.h"
12 #include "ash/shared/app_types.h"
12 #include "ash/shell.h" 13 #include "ash/shell.h"
13 #include "ash/wm/window_util.h" 14 #include "ash/wm/window_util.h"
14 #include "base/command_line.h" 15 #include "base/command_line.h"
15 #include "base/memory/ptr_util.h" 16 #include "base/memory/ptr_util.h"
16 #include "chromeos/audio/chromeos_sounds.h" 17 #include "chromeos/audio/chromeos_sounds.h"
17 #include "chromeos/audio/cras_audio_handler.h" 18 #include "chromeos/audio/cras_audio_handler.h"
18 #include "chromeos/chromeos_switches.h" 19 #include "chromeos/chromeos_switches.h"
20 #include "ui/aura/client/aura_constants.h"
19 #include "ui/chromeos/touch_exploration_controller.h" 21 #include "ui/chromeos/touch_exploration_controller.h"
20 #include "ui/wm/public/activation_client.h" 22 #include "ui/wm/public/activation_client.h"
21 23
22 namespace ash { 24 namespace ash {
23 25
24 AshTouchExplorationManager::AshTouchExplorationManager( 26 AshTouchExplorationManager::AshTouchExplorationManager(
25 RootWindowController* root_window_controller) 27 RootWindowController* root_window_controller)
26 : root_window_controller_(root_window_controller), 28 : root_window_controller_(root_window_controller),
27 audio_handler_(chromeos::CrasAudioHandler::Get()) { 29 audio_handler_(chromeos::CrasAudioHandler::Get()),
30 enable_chromevox_arc_support_(
31 base::CommandLine::ForCurrentProcess()->HasSwitch(
32 chromeos::switches::kEnableChromeVoxArcSupport)) {
28 WmShell::Get()->system_tray_notifier()->AddAccessibilityObserver(this); 33 WmShell::Get()->system_tray_notifier()->AddAccessibilityObserver(this);
29 Shell::GetInstance()->activation_client()->AddObserver(this); 34 Shell::GetInstance()->activation_client()->AddObserver(this);
30 display::Screen::GetScreen()->AddObserver(this); 35 display::Screen::GetScreen()->AddObserver(this);
31 UpdateTouchExplorationState(); 36 UpdateTouchExplorationState();
32 } 37 }
33 38
34 AshTouchExplorationManager::~AshTouchExplorationManager() { 39 AshTouchExplorationManager::~AshTouchExplorationManager() {
35 SystemTrayNotifier* system_tray_notifier = 40 SystemTrayNotifier* system_tray_notifier =
36 WmShell::Get()->system_tray_notifier(); 41 WmShell::Get()->system_tray_notifier();
37 if (system_tray_notifier) 42 if (system_tray_notifier)
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 130
126 void AshTouchExplorationManager::SetTouchAccessibilityAnchorPoint( 131 void AshTouchExplorationManager::SetTouchAccessibilityAnchorPoint(
127 const gfx::Point& anchor_point) { 132 const gfx::Point& anchor_point) {
128 if (touch_exploration_controller_) { 133 if (touch_exploration_controller_) {
129 touch_exploration_controller_->SetTouchAccessibilityAnchorPoint( 134 touch_exploration_controller_->SetTouchAccessibilityAnchorPoint(
130 anchor_point); 135 anchor_point);
131 } 136 }
132 } 137 }
133 138
134 void AshTouchExplorationManager::UpdateTouchExplorationState() { 139 void AshTouchExplorationManager::UpdateTouchExplorationState() {
135 // Comes from components/exo/shell_surface.cc.
136 const char kExoShellSurfaceWindowName[] = "ExoShellSurface";
137
138 // See crbug.com/603745 for more details. 140 // See crbug.com/603745 for more details.
139 const bool pass_through_surface = 141 const bool pass_through_surface =
140 wm::GetActiveWindow() && 142 wm::GetActiveWindow() &&
141 wm::GetActiveWindow()->GetName() == kExoShellSurfaceWindowName; 143 wm::GetActiveWindow()->GetProperty(aura::client::kAppType) ==
144 static_cast<int>(ash::AppType::ARC_APP) &&
145 !enable_chromevox_arc_support_;
142 146
143 const bool spoken_feedback_enabled = 147 const bool spoken_feedback_enabled =
144 Shell::GetInstance()->accessibility_delegate()->IsSpokenFeedbackEnabled(); 148 Shell::GetInstance()->accessibility_delegate()->IsSpokenFeedbackEnabled();
145 149
146 if (!touch_accessibility_enabler_) { 150 if (!touch_accessibility_enabler_) {
147 // Always enable gesture to toggle spoken feedback. 151 // Always enable gesture to toggle spoken feedback.
148 touch_accessibility_enabler_.reset(new ui::TouchAccessibilityEnabler( 152 touch_accessibility_enabler_.reset(new ui::TouchAccessibilityEnabler(
149 root_window_controller_->GetRootWindow(), this)); 153 root_window_controller_->GetRootWindow(), this));
150 } 154 }
151 155
(...skipping 18 matching lines...) Expand all
170 touch_exploration_controller_.reset(); 174 touch_exploration_controller_.reset();
171 } 175 }
172 } 176 }
173 177
174 bool AshTouchExplorationManager::VolumeAdjustSoundEnabled() { 178 bool AshTouchExplorationManager::VolumeAdjustSoundEnabled() {
175 return !base::CommandLine::ForCurrentProcess()->HasSwitch( 179 return !base::CommandLine::ForCurrentProcess()->HasSwitch(
176 chromeos::switches::kDisableVolumeAdjustSound); 180 chromeos::switches::kDisableVolumeAdjustSound);
177 } 181 }
178 182
179 } // namespace ash 183 } // namespace ash
OLDNEW
« no previous file with comments | « ash/ash_touch_exploration_manager_chromeos.h ('k') | components/exo/pointer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698