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" | 7 #include "ash/accelerators/magnifier_key_scroller.h" |
8 #include "ash/accelerators/spoken_feedback_toggler.h" | 8 #include "ash/accelerators/spoken_feedback_toggler.h" |
9 #include "ash/accessibility_delegate.h" | 9 #include "ash/accessibility_delegate.h" |
10 #include "ash/wm/mru_window_tracker.h" | 10 #include "ash/wm/mru_window_tracker.h" |
(...skipping 20 matching lines...) Expand all Loading... | |
31 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h" | 31 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h" |
32 #include "chrome/browser/ui/browser.h" | 32 #include "chrome/browser/ui/browser.h" |
33 #include "chrome/browser/ui/browser_finder.h" | 33 #include "chrome/browser/ui/browser_finder.h" |
34 #include "chrome/browser/ui/browser_window.h" | 34 #include "chrome/browser/ui/browser_window.h" |
35 #include "chrome/common/pref_names.h" | 35 #include "chrome/common/pref_names.h" |
36 #include "chromeos/chromeos_switches.h" | 36 #include "chromeos/chromeos_switches.h" |
37 #include "chromeos/ime/input_method_manager.h" | 37 #include "chromeos/ime/input_method_manager.h" |
38 #include "content/public/browser/notification_service.h" | 38 #include "content/public/browser/notification_service.h" |
39 #include "content/public/browser/user_metrics.h" | 39 #include "content/public/browser/user_metrics.h" |
40 #include "grit/generated_resources.h" | 40 #include "grit/generated_resources.h" |
41 #include "media/audio/sounds/sounds_manager.h" | |
41 #include "ui/aura/window.h" | 42 #include "ui/aura/window.h" |
42 #include "ui/base/l10n/l10n_util.h" | 43 #include "ui/base/l10n/l10n_util.h" |
43 | 44 |
44 namespace { | 45 namespace { |
45 | 46 |
46 void InitAfterSessionStart() { | 47 void InitAfterSessionStart() { |
47 // Restore focus after the user session is started. It's needed because some | 48 // Restore focus after the user session is started. It's needed because some |
48 // windows can be opened in background while login UI is still active because | 49 // windows can be opened in background while login UI is still active because |
49 // we currently restore browser windows before login UI is deleted. | 50 // we currently restore browser windows before login UI is deleted. |
50 ash::Shell* shell = ash::Shell::GetInstance(); | 51 ash::Shell* shell = ash::Shell::GetInstance(); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
192 case ash::A11Y_ALERT_NONE: | 193 case ash::A11Y_ALERT_NONE: |
193 break; | 194 break; |
194 } | 195 } |
195 } | 196 } |
196 } | 197 } |
197 | 198 |
198 virtual ash::AccessibilityAlert GetLastAccessibilityAlert() OVERRIDE { | 199 virtual ash::AccessibilityAlert GetLastAccessibilityAlert() OVERRIDE { |
199 return ash::A11Y_ALERT_NONE; | 200 return ash::A11Y_ALERT_NONE; |
200 } | 201 } |
201 | 202 |
203 virtual void PlayEarcon(media::SoundsManager::SoundKey sound_key) OVERRIDE { | |
204 DCHECK(chromeos::AccessibilityManager::Get()); | |
James Cook
2014/07/29 04:27:24
We don't generally DCHECK something just before de
dmazzoni
2014/07/29 05:47:50
I see that pattern a fair amount. Must be differen
James Cook
2014/07/29 15:45:51
Yeah. I use it as a way to establish preconditions
lisayin
2014/07/30 15:32:51
Acknowledged.
| |
205 return chromeos::AccessibilityManager::Get()->PlayEarcon(sound_key); | |
206 } | |
207 | |
202 virtual base::TimeDelta PlayShutdownSound() const OVERRIDE { | 208 virtual base::TimeDelta PlayShutdownSound() const OVERRIDE { |
203 return chromeos::AccessibilityManager::Get()->PlayShutdownSound(); | 209 return chromeos::AccessibilityManager::Get()->PlayShutdownSound(); |
204 } | 210 } |
205 | 211 |
206 private: | 212 private: |
207 DISALLOW_COPY_AND_ASSIGN(AccessibilityDelegateImpl); | 213 DISALLOW_COPY_AND_ASSIGN(AccessibilityDelegateImpl); |
208 }; | 214 }; |
209 | 215 |
210 } // anonymous namespace | 216 } // anonymous namespace |
211 | 217 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
275 } | 281 } |
276 | 282 |
277 void ChromeShellDelegate::PlatformInit() { | 283 void ChromeShellDelegate::PlatformInit() { |
278 registrar_.Add(this, | 284 registrar_.Add(this, |
279 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, | 285 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, |
280 content::NotificationService::AllSources()); | 286 content::NotificationService::AllSources()); |
281 registrar_.Add(this, | 287 registrar_.Add(this, |
282 chrome::NOTIFICATION_SESSION_STARTED, | 288 chrome::NOTIFICATION_SESSION_STARTED, |
283 content::NotificationService::AllSources()); | 289 content::NotificationService::AllSources()); |
284 } | 290 } |
OLD | NEW |