Chromium Code Reviews| OLD | NEW |
|---|---|
| 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()) { |
| 28 WmShell::Get()->system_tray_notifier()->AddAccessibilityObserver(this); | 30 WmShell::Get()->system_tray_notifier()->AddAccessibilityObserver(this); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 125 | 127 |
| 126 void AshTouchExplorationManager::SetTouchAccessibilityAnchorPoint( | 128 void AshTouchExplorationManager::SetTouchAccessibilityAnchorPoint( |
| 127 const gfx::Point& anchor_point) { | 129 const gfx::Point& anchor_point) { |
| 128 if (touch_exploration_controller_) { | 130 if (touch_exploration_controller_) { |
| 129 touch_exploration_controller_->SetTouchAccessibilityAnchorPoint( | 131 touch_exploration_controller_->SetTouchAccessibilityAnchorPoint( |
| 130 anchor_point); | 132 anchor_point); |
| 131 } | 133 } |
| 132 } | 134 } |
| 133 | 135 |
| 134 void AshTouchExplorationManager::UpdateTouchExplorationState() { | 136 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. | 137 // See crbug.com/603745 for more details. |
| 139 const bool pass_through_surface = | 138 const bool pass_through_surface = |
| 140 wm::GetActiveWindow() && | 139 wm::GetActiveWindow() && |
| 141 wm::GetActiveWindow()->GetName() == kExoShellSurfaceWindowName; | 140 wm::GetActiveWindow()->GetProperty(aura::client::kAppType) == |
| 141 static_cast<int>(ash::AppType::ARC_APP) && | |
| 142 !base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 143 chromeos::switches::kEnableChromeVoxArcSupport); | |
|
reveman
2017/03/16 22:42:19
nit: maybe check this command line switch in the c
David Tseng
2017/03/20 16:38:03
Shouldn't be an issue (this function gets called o
| |
| 142 | 144 |
| 143 const bool spoken_feedback_enabled = | 145 const bool spoken_feedback_enabled = |
| 144 Shell::GetInstance()->accessibility_delegate()->IsSpokenFeedbackEnabled(); | 146 Shell::GetInstance()->accessibility_delegate()->IsSpokenFeedbackEnabled(); |
| 145 | 147 |
| 146 if (!touch_accessibility_enabler_) { | 148 if (!touch_accessibility_enabler_) { |
| 147 // Always enable gesture to toggle spoken feedback. | 149 // Always enable gesture to toggle spoken feedback. |
| 148 touch_accessibility_enabler_.reset(new ui::TouchAccessibilityEnabler( | 150 touch_accessibility_enabler_.reset(new ui::TouchAccessibilityEnabler( |
| 149 root_window_controller_->GetRootWindow(), this)); | 151 root_window_controller_->GetRootWindow(), this)); |
| 150 } | 152 } |
| 151 | 153 |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 170 touch_exploration_controller_.reset(); | 172 touch_exploration_controller_.reset(); |
| 171 } | 173 } |
| 172 } | 174 } |
| 173 | 175 |
| 174 bool AshTouchExplorationManager::VolumeAdjustSoundEnabled() { | 176 bool AshTouchExplorationManager::VolumeAdjustSoundEnabled() { |
| 175 return !base::CommandLine::ForCurrentProcess()->HasSwitch( | 177 return !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 176 chromeos::switches::kDisableVolumeAdjustSound); | 178 chromeos::switches::kDisableVolumeAdjustSound); |
| 177 } | 179 } |
| 178 | 180 |
| 179 } // namespace ash | 181 } // namespace ash |
| OLD | NEW |