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

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

Issue 10829381: Remove call to UserManager::Get when initializing UserManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More fixes Created 8 years, 4 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_WALLPAPER_MANAGER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_WALLPAPER_MANAGER_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_WALLPAPER_MANAGER_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_WALLPAPER_MANAGER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "ash/desktop_background/desktop_background_resources.h" 10 #include "ash/desktop_background/desktop_background_resources.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 void RestartTimer(); 84 void RestartTimer();
85 85
86 // Tries to load user image from disk; if successful, sets it for the user, 86 // Tries to load user image from disk; if successful, sets it for the user,
87 // and updates Local State. 87 // and updates Local State.
88 void SetUserWallpaperFromFile(const std::string& username, 88 void SetUserWallpaperFromFile(const std::string& username,
89 const FilePath& path, 89 const FilePath& path,
90 ash::WallpaperLayout layout, 90 ash::WallpaperLayout layout,
91 base::WeakPtr<WallpaperDelegate> delegate); 91 base::WeakPtr<WallpaperDelegate> delegate);
92 92
93 // Set |email|'s wallpaper |type|, |index| and local date to local state. 93 // Set |email|'s wallpaper |type|, |index| and local date to local state.
94 // When |is_persistent| is false, changes are kept in memory only.
94 void SaveUserWallpaperProperties(const std::string& email, 95 void SaveUserWallpaperProperties(const std::string& email,
Ivan Korotkov 2012/08/17 19:10:57 Let's rename it to Set... because Save... already
bshe 2012/08/17 19:21:36 Done.
95 User::WallpaperType type, 96 User::WallpaperType type,
96 int index); 97 int index,
98 bool is_persistent);
97 99
98 // Sets one of the default wallpapers for the specified user and saves this 100 // Sets one of the default wallpapers for the specified user and saves this
99 // settings in local state. 101 // settings in local state.
100 void SetInitialUserWallpaper(const std::string& username); 102 void SetInitialUserWallpaper(const std::string& username, bool is_persistent);
101 103
102 // Saves |username| selected wallpaper information to local state. 104 // Saves |username| selected wallpaper information to local state.
103 void SaveUserWallpaperInfo(const std::string& username, 105 void SaveUserWallpaperInfo(const std::string& username,
104 const std::string& file_name, 106 const std::string& file_name,
105 ash::WallpaperLayout layout, 107 ash::WallpaperLayout layout,
106 User::WallpaperType type); 108 User::WallpaperType type);
107 109
108 // Sets last selected user on user pod row. 110 // Sets last selected user on user pod row.
109 void SetLastSelectedUser(const std::string& last_selected_user); 111 void SetLastSelectedUser(const std::string& last_selected_user);
110 112
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 void SaveWallpaper(const std::string& path, const UserImage& wallpaper); 180 void SaveWallpaper(const std::string& path, const UserImage& wallpaper);
179 181
180 // Saves wallpaper to file, post task to generate thumbnail and updates local 182 // Saves wallpaper to file, post task to generate thumbnail and updates local
181 // state preferences. 183 // state preferences.
182 void SetWallpaper(const std::string& username, 184 void SetWallpaper(const std::string& username,
183 ash::WallpaperLayout layout, 185 ash::WallpaperLayout layout,
184 User::WallpaperType type, 186 User::WallpaperType type,
185 base::WeakPtr<WallpaperDelegate> delegate, 187 base::WeakPtr<WallpaperDelegate> delegate,
186 const UserImage& wallpaper); 188 const UserImage& wallpaper);
187 189
190 // Returns flase if current logged in user is ephemeral and |email| is the
191 // email of current logged in user. We should not persist data for ephemeral
Ivan Korotkov 2012/08/17 19:10:57 Please rephrase this to what the function actually
bshe 2012/08/17 19:21:36 Done.
192 // user.
193 // Note: this function can not be called in SaveUserWallpaperProperties. It
194 // will create a deadlock. (issue 142440)
195 bool ShouldPersistDataForUser(const std::string& email);
196
188 // Sets wallpaper to image in |user_image| with |layout|. 197 // Sets wallpaper to image in |user_image| with |layout|.
189 void OnWallpaperLoaded(ash::WallpaperLayout layout, 198 void OnWallpaperLoaded(ash::WallpaperLayout layout,
190 const UserImage& user_image); 199 const UserImage& user_image);
191 200
192 // Overridden from chromeos::ResumeObserver 201 // Overridden from chromeos::ResumeObserver
193 virtual void SystemResumed() OVERRIDE; 202 virtual void SystemResumed() OVERRIDE;
194 203
195 // Overridden from system::TimezoneSettings::Observer. 204 // Overridden from system::TimezoneSettings::Observer.
196 virtual void TimezoneChanged(const icu::TimeZone& timezone) OVERRIDE; 205 virtual void TimezoneChanged(const icu::TimeZone& timezone) OVERRIDE;
197 206
(...skipping 21 matching lines...) Expand all
219 content::NotificationRegistrar registrar_; 228 content::NotificationRegistrar registrar_;
220 229
221 base::OneShotTimer<WallpaperManager> timer_; 230 base::OneShotTimer<WallpaperManager> timer_;
222 231
223 DISALLOW_COPY_AND_ASSIGN(WallpaperManager); 232 DISALLOW_COPY_AND_ASSIGN(WallpaperManager);
224 }; 233 };
225 234
226 } // namespace chromeos 235 } // namespace chromeos
227 236
228 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WALLPAPER_MANAGER_H_ 237 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WALLPAPER_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/user_manager_impl.cc ('k') | chrome/browser/chromeos/login/wallpaper_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698