Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: chrome/browser/chromeos/login/wallpaper_manager.cc

Issue 11741003: Remove PrefServiceSimple, replacing it with PrefService and PrefRegistrySimple. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix double registration in Chrome Frame test. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/logging.h"
12 #include "base/file_path.h" 11 #include "base/file_path.h"
13 #include "base/file_util.h" 12 #include "base/file_util.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/string_number_conversions.h" 16 #include "base/string_number_conversions.h"
17 #include "base/string_util.h" 17 #include "base/string_util.h"
18 #include "base/stringprintf.h" 18 #include "base/stringprintf.h"
19 #include "base/threading/worker_pool.h" 19 #include "base/threading/worker_pool.h"
20 #include "base/time.h" 20 #include "base/time.h"
21 #include "base/values.h" 21 #include "base/values.h"
22 #include "chrome/browser/browser_process.h" 22 #include "chrome/browser/browser_process.h"
23 #include "chrome/browser/chromeos/login/user.h" 23 #include "chrome/browser/chromeos/login/user.h"
24 #include "chrome/browser/chromeos/login/user_manager.h" 24 #include "chrome/browser/chromeos/login/user_manager.h"
25 #include "chrome/browser/chromeos/login/wizard_controller.h" 25 #include "chrome/browser/chromeos/login/wizard_controller.h"
26 #include "chrome/browser/chromeos/settings/cros_settings.h" 26 #include "chrome/browser/chromeos/settings/cros_settings.h"
27 #include "chrome/browser/prefs/pref_registry_simple.h"
27 #include "chrome/browser/prefs/pref_service.h" 28 #include "chrome/browser/prefs/pref_service.h"
28 #include "chrome/browser/prefs/scoped_user_pref_update.h" 29 #include "chrome/browser/prefs/scoped_user_pref_update.h"
29 #include "chrome/common/chrome_notification_types.h" 30 #include "chrome/common/chrome_notification_types.h"
30 #include "chrome/common/chrome_paths.h" 31 #include "chrome/common/chrome_paths.h"
31 #include "chrome/common/chrome_switches.h" 32 #include "chrome/common/chrome_switches.h"
32 #include "chrome/common/pref_names.h" 33 #include "chrome/common/pref_names.h"
33 #include "chromeos/dbus/dbus_thread_manager.h" 34 #include "chromeos/dbus/dbus_thread_manager.h"
34 #include "content/public/browser/browser_thread.h" 35 #include "content/public/browser/browser_thread.h"
35 #include "content/public/browser/notification_service.h" 36 #include "content/public/browser/notification_service.h"
36 #include "ui/base/resource/resource_bundle.h" 37 #include "ui/base/resource/resource_bundle.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 133
133 void WallpaperManager::Shutdown() { 134 void WallpaperManager::Shutdown() {
134 DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this); 135 DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this);
135 system::TimezoneSettings::GetInstance()->RemoveObserver(this); 136 system::TimezoneSettings::GetInstance()->RemoveObserver(this);
136 CrosSettings::Get()->RemoveSettingsObserver( 137 CrosSettings::Get()->RemoveSettingsObserver(
137 kAccountsPrefShowUserNamesOnSignIn, this); 138 kAccountsPrefShowUserNamesOnSignIn, this);
138 no_observers_ = true; 139 no_observers_ = true;
139 } 140 }
140 141
141 // static 142 // static
142 void WallpaperManager::RegisterPrefs(PrefServiceSimple* local_state) { 143 void WallpaperManager::RegisterPrefs(PrefRegistrySimple* registry) {
143 local_state->RegisterDictionaryPref(prefs::kUsersWallpaperInfo); 144 registry->RegisterDictionaryPref(prefs::kUsersWallpaperInfo);
144 local_state->RegisterDictionaryPref(kUserWallpapers); 145 registry->RegisterDictionaryPref(kUserWallpapers);
145 local_state->RegisterDictionaryPref(kUserWallpapersProperties); 146 registry->RegisterDictionaryPref(kUserWallpapersProperties);
146 } 147 }
147 148
148 void WallpaperManager::AddObservers() { 149 void WallpaperManager::AddObservers() {
149 DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(this); 150 DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(this);
150 system::TimezoneSettings::GetInstance()->AddObserver(this); 151 system::TimezoneSettings::GetInstance()->AddObserver(this);
151 CrosSettings::Get()->AddSettingsObserver(kAccountsPrefShowUserNamesOnSignIn, 152 CrosSettings::Get()->AddSettingsObserver(kAccountsPrefShowUserNamesOnSignIn,
152 this); 153 this);
153 no_observers_ = false; 154 no_observers_ = false;
154 } 155 }
155 156
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 908
908 void WallpaperManager::SystemResumed(const base::TimeDelta& sleep_duration) { 909 void WallpaperManager::SystemResumed(const base::TimeDelta& sleep_duration) {
909 BatchUpdateWallpaper(); 910 BatchUpdateWallpaper();
910 } 911 }
911 912
912 void WallpaperManager::TimezoneChanged(const icu::TimeZone& timezone) { 913 void WallpaperManager::TimezoneChanged(const icu::TimeZone& timezone) {
913 RestartTimer(); 914 RestartTimer();
914 } 915 }
915 916
916 } // chromeos 917 } // chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/wallpaper_manager.h ('k') | chrome/browser/chromeos/login/wizard_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698