OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/chromeos/login/wallpaper_manager.h" | 5 #include "chrome/browser/chromeos/login/wallpaper_manager.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
16 #include "base/prefs/pref_registry_simple.h" | 16 #include "base/prefs/pref_registry_simple.h" |
17 #include "base/prefs/pref_service.h" | 17 #include "base/prefs/pref_service.h" |
18 #include "base/string_util.h" | 18 #include "base/string_util.h" |
19 #include "base/stringprintf.h" | 19 #include "base/stringprintf.h" |
20 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
21 #include "base/threading/worker_pool.h" | 21 #include "base/threading/worker_pool.h" |
22 #include "base/time.h" | 22 #include "base/time.h" |
23 #include "base/values.h" | 23 #include "base/values.h" |
24 #include "chrome/browser/browser_process.h" | 24 #include "chrome/browser/browser_process.h" |
| 25 #include "chrome/browser/chromeos/login/startup_utils.h" |
25 #include "chrome/browser/chromeos/login/user.h" | 26 #include "chrome/browser/chromeos/login/user.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/wizard_controller.h" | 28 #include "chrome/browser/chromeos/login/wizard_controller.h" |
28 #include "chrome/browser/chromeos/settings/cros_settings.h" | 29 #include "chrome/browser/chromeos/settings/cros_settings.h" |
29 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 30 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
30 #include "chrome/common/chrome_notification_types.h" | 31 #include "chrome/common/chrome_notification_types.h" |
31 #include "chrome/common/chrome_paths.h" | 32 #include "chrome/common/chrome_paths.h" |
32 #include "chrome/common/chrome_switches.h" | 33 #include "chrome/common/chrome_switches.h" |
33 #include "chrome/common/pref_names.h" | 34 #include "chrome/common/pref_names.h" |
34 #include "chromeos/dbus/dbus_thread_manager.h" | 35 #include "chromeos/dbus/dbus_thread_manager.h" |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 | 259 |
259 // Zero delays is also set in autotests. | 260 // Zero delays is also set in autotests. |
260 if (WizardController::IsZeroDelayEnabled()) { | 261 if (WizardController::IsZeroDelayEnabled()) { |
261 // Ensure tests have some sort of wallpaper. | 262 // Ensure tests have some sort of wallpaper. |
262 ash::Shell::GetInstance()->desktop_background_controller()-> | 263 ash::Shell::GetInstance()->desktop_background_controller()-> |
263 CreateEmptyWallpaper(); | 264 CreateEmptyWallpaper(); |
264 return; | 265 return; |
265 } | 266 } |
266 | 267 |
267 if (!user_manager->IsUserLoggedIn()) { | 268 if (!user_manager->IsUserLoggedIn()) { |
268 if (!WizardController::IsDeviceRegistered()) | 269 if (!StartupUtils::IsDeviceRegistered()) |
269 SetDefaultWallpaper(); | 270 SetDefaultWallpaper(); |
270 else | 271 else |
271 InitializeRegisteredDeviceWallpaper(); | 272 InitializeRegisteredDeviceWallpaper(); |
272 return; | 273 return; |
273 } | 274 } |
274 SetUserWallpaper(user_manager->GetLoggedInUser()->email()); | 275 SetUserWallpaper(user_manager->GetLoggedInUser()->email()); |
275 } | 276 } |
276 | 277 |
277 void WallpaperManager::Observe(int type, | 278 void WallpaperManager::Observe(int type, |
278 const content::NotificationSource& source, | 279 const content::NotificationSource& source, |
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 | 1108 |
1108 void WallpaperManager::SystemResumed(const base::TimeDelta& sleep_duration) { | 1109 void WallpaperManager::SystemResumed(const base::TimeDelta& sleep_duration) { |
1109 BatchUpdateWallpaper(); | 1110 BatchUpdateWallpaper(); |
1110 } | 1111 } |
1111 | 1112 |
1112 void WallpaperManager::TimezoneChanged(const icu::TimeZone& timezone) { | 1113 void WallpaperManager::TimezoneChanged(const icu::TimeZone& timezone) { |
1113 RestartTimer(); | 1114 RestartTimer(); |
1114 } | 1115 } |
1115 | 1116 |
1116 } // chromeos | 1117 } // chromeos |
OLD | NEW |