summaryrefslogtreecommitdiffstats
path: root/ash/ash_touch_exploration_manager_chromeos.cc
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-23 04:30:50 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-23 04:30:50 +0000
commit6344f4206c189f03f90eb434cf2b28ba46c03f95 (patch)
tree131a0674b049df8045a48cb0ce4543e9a7ca3b77 /ash/ash_touch_exploration_manager_chromeos.cc
parent4ac270015d7a4cd169b55cba12188e4e8f9be290 (diff)
downloadchromium_src-6344f4206c189f03f90eb434cf2b28ba46c03f95.zip
chromium_src-6344f4206c189f03f90eb434cf2b28ba46c03f95.tar.gz
chromium_src-6344f4206c189f03f90eb434cf2b28ba46c03f95.tar.bz2
Revert 284819 because it introduces leaks in TestingBoundaries and
EnterSlideGestureState tests in TouchExplorationTest: Direct leak of 24 byte(s) in 1 object(s) allocated from: #0 0x448b2b in operator new(unsigned long) /usr/local/google/work/chromium/src/third_party/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:55 #1 0x14703f7 in ui::GestureProviderAura::GetAndResetPendingGestures() ui/events/gestures/gesture_provider_aura.cc:112 #2 0x9f4986 in ui::TouchExplorationController::InSlideGesture(ui::TouchEvent const&, scoped_ptr\u003Cui::Event, base::DefaultDeleter\u003Cui::Event> >*) ui/chromeos/touch_exploration_controller.cc:578 ... etc. > Added side slide gestures to touch exploration controller. > > The user can control settings that might be normally changed using sliders by sliding along the edge of the screen when ChromeVox is on. For example, the user can slide along the right edge of the screen and adjust the volume. > > If the user enters this mode and leaves the boundaries without releasing their touch, they will stop adjusting the setting, however, they will not enter touch exploration. If they return to the given boundaries, they will be able to modify the setting again. If the user does not touch a "hot edge" of the screen, they will not enter this state if they move to the an of the screen. > > BUG=393326 > > Review URL: https://codereview.chromium.org/385073009 TBR=lisayin@chromium.org Review URL: https://codereview.chromium.org/407073008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284849 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/ash_touch_exploration_manager_chromeos.cc')
-rw-r--r--ash/ash_touch_exploration_manager_chromeos.cc78
1 files changed, 0 insertions, 78 deletions
diff --git a/ash/ash_touch_exploration_manager_chromeos.cc b/ash/ash_touch_exploration_manager_chromeos.cc
deleted file mode 100644
index f5e212b..0000000
--- a/ash/ash_touch_exploration_manager_chromeos.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ash/ash_touch_exploration_manager_chromeos.h"
-
-#include "ash/accessibility_delegate.h"
-#include "ash/audio/sounds.h"
-#include "ash/root_window_controller.h"
-#include "ash/shell.h"
-#include "ash/system/tray/system_tray_notifier.h"
-#include "base/command_line.h"
-#include "chromeos/audio/chromeos_sounds.h"
-#include "chromeos/audio/cras_audio_handler.h"
-#include "chromeos/chromeos_switches.h"
-#include "ui/chromeos/touch_exploration_controller.h"
-
-namespace ash {
-
-AshTouchExplorationManager::AshTouchExplorationManager(
- RootWindowController* root_window_controller)
- : root_window_controller_(root_window_controller),
- audio_handler_(chromeos::CrasAudioHandler::Get()) {
- Shell::GetInstance()->system_tray_notifier()->AddAccessibilityObserver(this);
- UpdateTouchExplorationState();
-}
-
-AshTouchExplorationManager::~AshTouchExplorationManager() {
- SystemTrayNotifier* system_tray_notifier =
- Shell::GetInstance()->system_tray_notifier();
- if (system_tray_notifier)
- system_tray_notifier->RemoveAccessibilityObserver(this);
-}
-
-void AshTouchExplorationManager::OnAccessibilityModeChanged(
- AccessibilityNotificationVisibility notify) {
- UpdateTouchExplorationState();
-}
-
-void AshTouchExplorationManager::PlayVolumeAdjustSound() {
- if (!VolumeAdjustSoundEnabled())
- return;
- if ((!audio_handler_->IsOutputMuted()) ||
- !(audio_handler_->GetOutputVolumePercent() == 100))
- PlaySystemSoundIfSpokenFeedback(chromeos::SOUND_VOLUME_ADJUST);
-}
-
-void AshTouchExplorationManager::SetOutputLevel(int volume) {
- if (volume > 0) {
- if (audio_handler_->IsOutputMuted()) {
- audio_handler_->SetOutputMute(false);
- }
- }
- audio_handler_->SetOutputVolumePercent(volume);
- // Avoid negative volume.
- if (audio_handler_->IsOutputVolumeBelowDefaultMuteLevel())
- audio_handler_->SetOutputMute(true);
-}
-
-void AshTouchExplorationManager::UpdateTouchExplorationState() {
- AccessibilityDelegate* delegate =
- Shell::GetInstance()->accessibility_delegate();
- bool enabled = delegate->IsSpokenFeedbackEnabled();
-
- if (enabled && !touch_exploration_controller_.get()) {
- touch_exploration_controller_.reset(new ui::TouchExplorationController(
- root_window_controller_->GetRootWindow(), this));
- } else if (!enabled) {
- touch_exploration_controller_.reset();
- }
-}
-
-bool AshTouchExplorationManager::VolumeAdjustSoundEnabled() {
- return !CommandLine::ForCurrentProcess()->HasSwitch(
- chromeos::switches::kDisableVolumeAdjustSound);
-}
-
-} // namespace ash