OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/ash/chrome_shell_delegate.h" | 5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
6 | 6 |
| 7 #include "ash/accelerators/magnifier_key_scroller.h" |
| 8 #include "ash/accelerators/spoken_feedback_toggler.h" |
7 #include "ash/accessibility_delegate.h" | 9 #include "ash/accessibility_delegate.h" |
8 #include "ash/magnifier/magnifier_key_scroller.h" | |
9 #include "ash/media_delegate.h" | 10 #include "ash/media_delegate.h" |
10 #include "ash/wm/mru_window_tracker.h" | 11 #include "ash/wm/mru_window_tracker.h" |
11 #include "ash/wm/window_util.h" | 12 #include "ash/wm/window_util.h" |
12 #include "base/command_line.h" | 13 #include "base/command_line.h" |
13 #include "base/prefs/pref_service.h" | 14 #include "base/prefs/pref_service.h" |
14 #include "chrome/browser/accessibility/accessibility_events.h" | 15 #include "chrome/browser/accessibility/accessibility_events.h" |
15 #include "chrome/browser/app_mode/app_mode_utils.h" | 16 #include "chrome/browser/app_mode/app_mode_utils.h" |
16 #include "chrome/browser/chrome_notification_types.h" | 17 #include "chrome/browser/chrome_notification_types.h" |
17 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 18 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
18 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 19 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
(...skipping 28 matching lines...) Expand all Loading... |
47 // Restor focus after the user session is started. It's needed | 48 // Restor focus after the user session is started. It's needed |
48 // because some windows can be opened in background while login UI | 49 // because some windows can be opened in background while login UI |
49 // is still active because we currently restore browser windows | 50 // is still active because we currently restore browser windows |
50 // before login UI is deleted. | 51 // before login UI is deleted. |
51 ash::Shell* shell = ash::Shell::GetInstance(); | 52 ash::Shell* shell = ash::Shell::GetInstance(); |
52 ash::MruWindowTracker::WindowList mru_list = | 53 ash::MruWindowTracker::WindowList mru_list = |
53 shell->mru_window_tracker()->BuildMruWindowList(); | 54 shell->mru_window_tracker()->BuildMruWindowList(); |
54 if (!mru_list.empty()) | 55 if (!mru_list.empty()) |
55 mru_list.front()->Focus(); | 56 mru_list.front()->Focus(); |
56 | 57 |
57 // Enable magnifier accelerators as there may be no mouse cursor in | 58 // Enable magnifier scroll keys as there may be no mouse cursor in |
58 // kiosk mode. | 59 // kiosk mode. |
59 ash::MagnifierKeyScroller::SetEnabled(chrome::IsRunningInForcedAppMode()); | 60 ash::MagnifierKeyScroller::SetEnabled(chrome::IsRunningInForcedAppMode()); |
| 61 |
| 62 // Enable long press action to toggle spoken feedback with hotrod |
| 63 // remote which can't handle shortcut. |
| 64 ash::SpokenFeedbackToggler::SetEnabled(chrome::IsRunningInForcedAppMode()); |
60 } | 65 } |
61 | 66 |
62 class AccessibilityDelegateImpl : public ash::AccessibilityDelegate { | 67 class AccessibilityDelegateImpl : public ash::AccessibilityDelegate { |
63 public: | 68 public: |
64 AccessibilityDelegateImpl() {} | 69 AccessibilityDelegateImpl() {} |
65 virtual ~AccessibilityDelegateImpl() {} | 70 virtual ~AccessibilityDelegateImpl() {} |
66 | 71 |
67 virtual void ToggleHighContrast() OVERRIDE { | 72 virtual void ToggleHighContrast() OVERRIDE { |
68 DCHECK(chromeos::AccessibilityManager::Get()); | 73 DCHECK(chromeos::AccessibilityManager::Get()); |
69 chromeos::AccessibilityManager::Get()->EnableHighContrast( | 74 chromeos::AccessibilityManager::Get()->EnableHighContrast( |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 registrar_.Add(this, | 298 registrar_.Add(this, |
294 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, | 299 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, |
295 content::NotificationService::AllSources()); | 300 content::NotificationService::AllSources()); |
296 registrar_.Add(this, | 301 registrar_.Add(this, |
297 chrome::NOTIFICATION_SESSION_STARTED, | 302 chrome::NOTIFICATION_SESSION_STARTED, |
298 content::NotificationService::AllSources()); | 303 content::NotificationService::AllSources()); |
299 registrar_.Add(this, | 304 registrar_.Add(this, |
300 chrome::NOTIFICATION_APP_TERMINATING, | 305 chrome::NOTIFICATION_APP_TERMINATING, |
301 content::NotificationService::AllSources()); | 306 content::NotificationService::AllSources()); |
302 } | 307 } |
OLD | NEW |