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/keyboard_overlay/keyboard_overlay_view.h" | 7 #include "ash/keyboard_overlay/keyboard_overlay_view.h" |
8 #include "ash/wm/window_util.h" | 8 #include "ash/wm/window_util.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
11 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 11 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
12 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 12 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
13 #include "chrome/browser/chromeos/background/ash_user_wallpaper_delegate.h" | 13 #include "chrome/browser/chromeos/background/ash_user_wallpaper_delegate.h" |
14 #include "chrome/browser/chromeos/display/display_preferences.h" | 14 #include "chrome/browser/chromeos/display/display_preferences.h" |
15 #include "chrome/browser/chromeos/extensions/file_manager/file_manager_util.h" | 15 #include "chrome/browser/chromeos/extensions/file_manager/file_manager_util.h" |
16 #include "chrome/browser/chromeos/extensions/media_player_api.h" | 16 #include "chrome/browser/chromeos/extensions/media_player_api.h" |
17 #include "chrome/browser/chromeos/extensions/media_player_event_router.h" | 17 #include "chrome/browser/chromeos/extensions/media_player_event_router.h" |
18 #include "chrome/browser/chromeos/login/login_display_host_impl.h" | 18 #include "chrome/browser/chromeos/login/login_display_host_impl.h" |
19 #include "chrome/browser/chromeos/login/screen_locker.h" | 19 #include "chrome/browser/chromeos/login/screen_locker.h" |
20 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h" | 20 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h" |
21 #include "chrome/browser/extensions/api/terminal/terminal_extension_helper.h" | 21 #include "chrome/browser/extensions/api/terminal/terminal_extension_helper.h" |
22 #include "chrome/browser/extensions/extension_service.h" | 22 #include "chrome/browser/extensions/extension_service.h" |
23 #include "chrome/browser/extensions/shell_window_registry.h" | 23 #include "chrome/browser/extensions/shell_window_registry.h" |
24 #include "chrome/browser/profiles/profile_manager.h" | 24 #include "chrome/browser/profiles/profile_manager.h" |
25 #include "chrome/browser/speech/tts_controller.h" | 25 #include "chrome/browser/speech/tts_controller.h" |
26 #include "chrome/browser/ui/ash/caps_lock_delegate_chromeos.h" | 26 #include "chrome/browser/ui/ash/caps_lock_delegate_chromeos.h" |
| 27 #include "chrome/browser/ui/ash/session_state_delegate_chromeos.h" |
27 #include "chrome/browser/ui/ash/window_positioner.h" | 28 #include "chrome/browser/ui/ash/window_positioner.h" |
28 #include "chrome/browser/ui/browser.h" | 29 #include "chrome/browser/ui/browser.h" |
29 #include "chrome/browser/ui/browser_finder.h" | 30 #include "chrome/browser/ui/browser_finder.h" |
30 #include "chrome/browser/ui/browser_window.h" | 31 #include "chrome/browser/ui/browser_window.h" |
31 #include "chrome/browser/ui/extensions/application_launch.h" | 32 #include "chrome/browser/ui/extensions/application_launch.h" |
32 #include "chrome/browser/ui/extensions/native_app_window.h" | 33 #include "chrome/browser/ui/extensions/native_app_window.h" |
33 #include "chrome/browser/ui/extensions/shell_window.h" | 34 #include "chrome/browser/ui/extensions/shell_window.h" |
34 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h" | 35 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h" |
35 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 36 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
36 #include "chrome/common/chrome_switches.h" | 37 #include "chrome/common/chrome_switches.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 } | 180 } |
180 return std::numeric_limits<double>::min(); | 181 return std::numeric_limits<double>::min(); |
181 } | 182 } |
182 | 183 |
183 ash::CapsLockDelegate* ChromeShellDelegate::CreateCapsLockDelegate() { | 184 ash::CapsLockDelegate* ChromeShellDelegate::CreateCapsLockDelegate() { |
184 chromeos::input_method::XKeyboard* xkeyboard = | 185 chromeos::input_method::XKeyboard* xkeyboard = |
185 chromeos::input_method::InputMethodManager::Get()->GetXKeyboard(); | 186 chromeos::input_method::InputMethodManager::Get()->GetXKeyboard(); |
186 return new CapsLockDelegate(xkeyboard); | 187 return new CapsLockDelegate(xkeyboard); |
187 } | 188 } |
188 | 189 |
| 190 ash::SessionStateDelegate* ChromeShellDelegate::CreateSessionStateDelegate() { |
| 191 return new SessionStateDelegateChromeos; |
| 192 } |
| 193 |
189 void ChromeShellDelegate::ShowKeyboardOverlay() { | 194 void ChromeShellDelegate::ShowKeyboardOverlay() { |
190 // TODO(mazda): Move the show logic to ash (http://crbug.com/124222). | 195 // TODO(mazda): Move the show logic to ash (http://crbug.com/124222). |
191 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); | 196 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); |
192 std::string url(chrome::kChromeUIKeyboardOverlayURL); | 197 std::string url(chrome::kChromeUIKeyboardOverlayURL); |
193 ash::KeyboardOverlayView::ShowDialog(profile, | 198 ash::KeyboardOverlayView::ShowDialog(profile, |
194 new ChromeWebContentsHandler, | 199 new ChromeWebContentsHandler, |
195 GURL(url)); | 200 GURL(url)); |
196 } | 201 } |
197 | 202 |
198 bool ChromeShellDelegate::ShouldAlwaysShowAccessibilityMenu() const { | 203 bool ChromeShellDelegate::ShouldAlwaysShowAccessibilityMenu() const { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 } | 256 } |
252 | 257 |
253 void ChromeShellDelegate::PlatformInit() { | 258 void ChromeShellDelegate::PlatformInit() { |
254 registrar_.Add(this, | 259 registrar_.Add(this, |
255 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, | 260 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, |
256 content::NotificationService::AllSources()); | 261 content::NotificationService::AllSources()); |
257 registrar_.Add(this, | 262 registrar_.Add(this, |
258 chrome::NOTIFICATION_SESSION_STARTED, | 263 chrome::NOTIFICATION_SESSION_STARTED, |
259 content::NotificationService::AllSources()); | 264 content::NotificationService::AllSources()); |
260 } | 265 } |
OLD | NEW |