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/system/chromeos/network/network_observer.h" | 8 #include "ash/system/chromeos/network/network_observer.h" |
9 #include "ash/system/tray/system_tray_notifier.h" | 9 #include "ash/system/tray/system_tray_notifier.h" |
10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
11 #include "base/chromeos/chromeos_version.h" | 11 #include "base/chromeos/chromeos_version.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/prefs/pref_service.h" | 13 #include "base/prefs/pref_service.h" |
14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
15 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" | 15 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" |
16 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 16 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
17 #include "chrome/browser/chromeos/background/ash_user_wallpaper_delegate.h" | 17 #include "chrome/browser/chromeos/background/ash_user_wallpaper_delegate.h" |
18 #include "chrome/browser/chromeos/cros/cros_library.h" | 18 #include "chrome/browser/chromeos/cros/cros_library.h" |
19 #include "chrome/browser/chromeos/cros/network_library.h" | 19 #include "chrome/browser/chromeos/cros/network_library.h" |
| 20 #include "chrome/browser/chromeos/display/display_preferences.h" |
20 #include "chrome/browser/chromeos/extensions/file_manager_util.h" | 21 #include "chrome/browser/chromeos/extensions/file_manager_util.h" |
21 #include "chrome/browser/chromeos/extensions/media_player_api.h" | 22 #include "chrome/browser/chromeos/extensions/media_player_api.h" |
22 #include "chrome/browser/chromeos/extensions/media_player_event_router.h" | 23 #include "chrome/browser/chromeos/extensions/media_player_event_router.h" |
23 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" | 24 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" |
24 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 25 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
25 #include "chrome/browser/chromeos/login/screen_locker.h" | 26 #include "chrome/browser/chromeos/login/screen_locker.h" |
26 #include "chrome/browser/chromeos/login/user_manager.h" | 27 #include "chrome/browser/chromeos/login/user_manager.h" |
27 #include "chrome/browser/chromeos/login/webui_login_display_host.h" | 28 #include "chrome/browser/chromeos/login/webui_login_display_host.h" |
28 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h" | 29 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h" |
29 #include "chrome/browser/extensions/api/terminal/terminal_extension_helper.h" | 30 #include "chrome/browser/extensions/api/terminal/terminal_extension_helper.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 RequestLockScreen(); | 86 RequestLockScreen(); |
86 } | 87 } |
87 } | 88 } |
88 | 89 |
89 bool ChromeShellDelegate::IsScreenLocked() const { | 90 bool ChromeShellDelegate::IsScreenLocked() const { |
90 if (!chromeos::ScreenLocker::default_screen_locker()) | 91 if (!chromeos::ScreenLocker::default_screen_locker()) |
91 return false; | 92 return false; |
92 return chromeos::ScreenLocker::default_screen_locker()->locked(); | 93 return chromeos::ScreenLocker::default_screen_locker()->locked(); |
93 } | 94 } |
94 | 95 |
| 96 void ChromeShellDelegate::OnPreInit() { |
| 97 chromeos::LoadDisplayPreferences(); |
| 98 } |
| 99 |
95 void ChromeShellDelegate::Shutdown() { | 100 void ChromeShellDelegate::Shutdown() { |
96 content::RecordAction(content::UserMetricsAction("Shutdown")); | 101 content::RecordAction(content::UserMetricsAction("Shutdown")); |
97 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 102 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
98 RequestShutdown(); | 103 RequestShutdown(); |
99 } | 104 } |
100 | 105 |
101 void ChromeShellDelegate::OpenFileManager(bool as_dialog) { | 106 void ChromeShellDelegate::OpenFileManager(bool as_dialog) { |
102 if (as_dialog) { | 107 if (as_dialog) { |
103 Browser* browser = | 108 Browser* browser = |
104 chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()); | 109 chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()); |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 } | 297 } |
293 | 298 |
294 void ChromeShellDelegate::PlatformInit() { | 299 void ChromeShellDelegate::PlatformInit() { |
295 registrar_.Add(this, | 300 registrar_.Add(this, |
296 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, | 301 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, |
297 content::NotificationService::AllSources()); | 302 content::NotificationService::AllSources()); |
298 registrar_.Add(this, | 303 registrar_.Add(this, |
299 chrome::NOTIFICATION_SESSION_STARTED, | 304 chrome::NOTIFICATION_SESSION_STARTED, |
300 content::NotificationService::AllSources()); | 305 content::NotificationService::AllSources()); |
301 } | 306 } |
OLD | NEW |