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

Side by Side Diff: ash/ash_touch_exploration_manager_chromeos.cc

Issue 2775973002: Promotes more accessors from WmShell to Shell (Closed)
Patch Set: feedback 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
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"
10 #include "ash/common/wm_window.h" 9 #include "ash/common/wm_window.h"
11 #include "ash/root_window_controller.h" 10 #include "ash/root_window_controller.h"
12 #include "ash/shared/app_types.h" 11 #include "ash/shared/app_types.h"
13 #include "ash/shell.h" 12 #include "ash/shell.h"
14 #include "ash/wm/window_util.h" 13 #include "ash/wm/window_util.h"
15 #include "base/command_line.h" 14 #include "base/command_line.h"
16 #include "base/memory/ptr_util.h" 15 #include "base/memory/ptr_util.h"
17 #include "chromeos/audio/chromeos_sounds.h" 16 #include "chromeos/audio/chromeos_sounds.h"
18 #include "chromeos/audio/cras_audio_handler.h" 17 #include "chromeos/audio/cras_audio_handler.h"
19 #include "chromeos/chromeos_switches.h" 18 #include "chromeos/chromeos_switches.h"
20 #include "ui/aura/client/aura_constants.h" 19 #include "ui/aura/client/aura_constants.h"
21 #include "ui/chromeos/touch_exploration_controller.h" 20 #include "ui/chromeos/touch_exploration_controller.h"
22 #include "ui/wm/public/activation_client.h" 21 #include "ui/wm/public/activation_client.h"
23 22
24 namespace ash { 23 namespace ash {
25 24
26 AshTouchExplorationManager::AshTouchExplorationManager( 25 AshTouchExplorationManager::AshTouchExplorationManager(
27 RootWindowController* root_window_controller) 26 RootWindowController* root_window_controller)
28 : root_window_controller_(root_window_controller), 27 : root_window_controller_(root_window_controller),
29 audio_handler_(chromeos::CrasAudioHandler::Get()), 28 audio_handler_(chromeos::CrasAudioHandler::Get()),
30 enable_chromevox_arc_support_( 29 enable_chromevox_arc_support_(
31 base::CommandLine::ForCurrentProcess()->HasSwitch( 30 base::CommandLine::ForCurrentProcess()->HasSwitch(
32 chromeos::switches::kEnableChromeVoxArcSupport)) { 31 chromeos::switches::kEnableChromeVoxArcSupport)) {
33 WmShell::Get()->system_tray_notifier()->AddAccessibilityObserver(this); 32 Shell::Get()->system_tray_notifier()->AddAccessibilityObserver(this);
34 Shell::GetInstance()->activation_client()->AddObserver(this); 33 Shell::GetInstance()->activation_client()->AddObserver(this);
35 display::Screen::GetScreen()->AddObserver(this); 34 display::Screen::GetScreen()->AddObserver(this);
36 UpdateTouchExplorationState(); 35 UpdateTouchExplorationState();
37 } 36 }
38 37
39 AshTouchExplorationManager::~AshTouchExplorationManager() { 38 AshTouchExplorationManager::~AshTouchExplorationManager() {
40 SystemTrayNotifier* system_tray_notifier = 39 SystemTrayNotifier* system_tray_notifier =
41 WmShell::Get()->system_tray_notifier(); 40 Shell::Get()->system_tray_notifier();
42 if (system_tray_notifier) 41 if (system_tray_notifier)
43 system_tray_notifier->RemoveAccessibilityObserver(this); 42 system_tray_notifier->RemoveAccessibilityObserver(this);
44 Shell::GetInstance()->activation_client()->RemoveObserver(this); 43 Shell::GetInstance()->activation_client()->RemoveObserver(this);
45 display::Screen::GetScreen()->RemoveObserver(this); 44 display::Screen::GetScreen()->RemoveObserver(this);
46 } 45 }
47 46
48 void AshTouchExplorationManager::OnAccessibilityModeChanged( 47 void AshTouchExplorationManager::OnAccessibilityModeChanged(
49 AccessibilityNotificationVisibility notify) { 48 AccessibilityNotificationVisibility notify) {
50 UpdateTouchExplorationState(); 49 UpdateTouchExplorationState();
51 } 50 }
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 touch_exploration_controller_.reset(); 173 touch_exploration_controller_.reset();
175 } 174 }
176 } 175 }
177 176
178 bool AshTouchExplorationManager::VolumeAdjustSoundEnabled() { 177 bool AshTouchExplorationManager::VolumeAdjustSoundEnabled() {
179 return !base::CommandLine::ForCurrentProcess()->HasSwitch( 178 return !base::CommandLine::ForCurrentProcess()->HasSwitch(
180 chromeos::switches::kDisableVolumeAdjustSound); 179 chromeos::switches::kDisableVolumeAdjustSound);
181 } 180 }
182 181
183 } // namespace ash 182 } // namespace ash
OLDNEW
« no previous file with comments | « ash/accelerators/accelerator_interactive_uitest_chromeos.cc ('k') | ash/common/accelerators/accelerator_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698