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

Side by Side Diff: ash/ash_touch_exploration_manager_chromeos.cc

Issue 410783002: Corner Passthrough for Accessibility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@side-gestures
Patch Set: Added tests and Rebase off Master Created 6 years, 5 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
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/accessibility_delegate.h" 7 #include "ash/accessibility_delegate.h"
8 #include "ash/audio/sounds.h" 8 #include "ash/audio/sounds.h"
9 #include "ash/root_window_controller.h" 9 #include "ash/root_window_controller.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 if (audio_handler_->IsOutputMuted()) { 50 if (audio_handler_->IsOutputMuted()) {
51 audio_handler_->SetOutputMute(false); 51 audio_handler_->SetOutputMute(false);
52 } 52 }
53 } 53 }
54 audio_handler_->SetOutputVolumePercent(volume); 54 audio_handler_->SetOutputVolumePercent(volume);
55 // Avoid negative volume. 55 // Avoid negative volume.
56 if (audio_handler_->IsOutputVolumeBelowDefaultMuteLevel()) 56 if (audio_handler_->IsOutputVolumeBelowDefaultMuteLevel())
57 audio_handler_->SetOutputMute(true); 57 audio_handler_->SetOutputMute(true);
58 } 58 }
59 59
60 void AshTouchExplorationManager::PlayEarCon() {
61 if (!VolumeAdjustSoundEnabled())
62 return;
63 PlaySystemSoundIfSpokenFeedback(chromeos::SOUND_VOLUME_ADJUST);
aboxhall 2014/07/24 18:26:34 nit: indentation
lisayin 2014/07/25 20:11:57 Done.
64 }
60 void AshTouchExplorationManager::UpdateTouchExplorationState() { 65 void AshTouchExplorationManager::UpdateTouchExplorationState() {
61 AccessibilityDelegate* delegate = 66 AccessibilityDelegate* delegate =
62 Shell::GetInstance()->accessibility_delegate(); 67 Shell::GetInstance()->accessibility_delegate();
63 bool enabled = delegate->IsSpokenFeedbackEnabled(); 68 bool enabled = delegate->IsSpokenFeedbackEnabled();
64 69
65 if (enabled && !touch_exploration_controller_.get()) { 70 if (enabled && !touch_exploration_controller_.get()) {
66 touch_exploration_controller_.reset(new ui::TouchExplorationController( 71 touch_exploration_controller_.reset(new ui::TouchExplorationController(
67 root_window_controller_->GetRootWindow(), this)); 72 root_window_controller_->GetRootWindow(), this));
68 } else if (!enabled) { 73 } else if (!enabled) {
69 touch_exploration_controller_.reset(); 74 touch_exploration_controller_.reset();
70 } 75 }
71 } 76 }
72 77
73 bool AshTouchExplorationManager::VolumeAdjustSoundEnabled() { 78 bool AshTouchExplorationManager::VolumeAdjustSoundEnabled() {
74 return !CommandLine::ForCurrentProcess()->HasSwitch( 79 return !CommandLine::ForCurrentProcess()->HasSwitch(
75 chromeos::switches::kDisableVolumeAdjustSound); 80 chromeos::switches::kDisableVolumeAdjustSound);
76 } 81 }
77 82
78 } // namespace ash 83 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698