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

Unified Diff: ash/ash_touch_exploration_manager_chromeos.cc

Issue 2101263004: mash: Migrate AccessibilityDelegate access to WmShell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 4 years, 6 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/accelerators/spoken_feedback_toggler_unittest.cc ('k') | ash/audio/sounds.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/ash_touch_exploration_manager_chromeos.cc
diff --git a/ash/ash_touch_exploration_manager_chromeos.cc b/ash/ash_touch_exploration_manager_chromeos.cc
index ee9ca3df1958726c17a90b20db340ec275af426f..ff01bd711868c2b3bb8c0b6f08fc2f5b5e42bc16 100644
--- a/ash/ash_touch_exploration_manager_chromeos.cc
+++ b/ash/ash_touch_exploration_manager_chromeos.cc
@@ -55,11 +55,8 @@ void AshTouchExplorationManager::SetOutputLevel(int volume) {
}
void AshTouchExplorationManager::SilenceSpokenFeedback() {
- AccessibilityDelegate* delegate =
- Shell::GetInstance()->accessibility_delegate();
- if (!delegate->IsSpokenFeedbackEnabled())
- return;
- delegate->SilenceSpokenFeedback();
+ if (WmShell::Get()->GetAccessibilityDelegate()->IsSpokenFeedbackEnabled())
+ WmShell::Get()->GetAccessibilityDelegate()->SilenceSpokenFeedback();
}
void AshTouchExplorationManager::PlayVolumeAdjustEarcon() {
@@ -71,23 +68,23 @@ void AshTouchExplorationManager::PlayVolumeAdjustEarcon() {
}
void AshTouchExplorationManager::PlayPassthroughEarcon() {
- Shell::GetInstance()->accessibility_delegate()->PlayEarcon(
+ WmShell::Get()->GetAccessibilityDelegate()->PlayEarcon(
chromeos::SOUND_PASSTHROUGH);
}
void AshTouchExplorationManager::PlayExitScreenEarcon() {
- Shell::GetInstance()->accessibility_delegate()->PlayEarcon(
+ WmShell::Get()->GetAccessibilityDelegate()->PlayEarcon(
chromeos::SOUND_EXIT_SCREEN);
}
void AshTouchExplorationManager::PlayEnterScreenEarcon() {
- Shell::GetInstance()->accessibility_delegate()->PlayEarcon(
+ WmShell::Get()->GetAccessibilityDelegate()->PlayEarcon(
chromeos::SOUND_ENTER_SCREEN);
}
void AshTouchExplorationManager::HandleAccessibilityGesture(
ui::AXGesture gesture) {
- Shell::GetInstance()->accessibility_delegate()->HandleAccessibilityGesture(
+ WmShell::Get()->GetAccessibilityDelegate()->HandleAccessibilityGesture(
gesture);
}
@@ -111,19 +108,18 @@ void AshTouchExplorationManager::UpdateTouchExplorationState() {
const char kExoShellSurfaceWindowName[] = "ExoShellSurface";
// See crbug.com/603745 for more details.
- bool pass_through_surface =
+ const bool pass_through_surface =
wm::GetActiveWindow() &&
wm::GetActiveWindow()->name() == kExoShellSurfaceWindowName;
- AccessibilityDelegate* delegate =
- Shell::GetInstance()->accessibility_delegate();
- bool enabled = delegate->IsSpokenFeedbackEnabled();
+ const bool spoken_feedback_enabled =
+ WmShell::Get()->GetAccessibilityDelegate()->IsSpokenFeedbackEnabled();
- if (!pass_through_surface && enabled &&
+ if (!pass_through_surface && spoken_feedback_enabled &&
!touch_exploration_controller_.get()) {
touch_exploration_controller_.reset(new ui::TouchExplorationController(
root_window_controller_->GetRootWindow(), this));
- } else if (!enabled || pass_through_surface) {
+ } else if (!spoken_feedback_enabled || pass_through_surface) {
touch_exploration_controller_.reset();
}
}
« no previous file with comments | « ash/accelerators/spoken_feedback_toggler_unittest.cc ('k') | ash/audio/sounds.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698