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

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

Issue 10832019: Speed up custom wallpaper switching time and wallpaper manager code refactor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile 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_USER_MANAGER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 // Indicates that user just logged on as the demo user. 104 // Indicates that user just logged on as the demo user.
105 virtual void DemoUserLoggedIn() = 0; 105 virtual void DemoUserLoggedIn() = 0;
106 106
107 // Indicates that user just started incognito session. 107 // Indicates that user just started incognito session.
108 virtual void GuestUserLoggedIn() = 0; 108 virtual void GuestUserLoggedIn() = 0;
109 109
110 // Indicates that a user just logged in as ephemeral. 110 // Indicates that a user just logged in as ephemeral.
111 virtual void EphemeralUserLoggedIn(const std::string& email) = 0; 111 virtual void EphemeralUserLoggedIn(const std::string& email) = 0;
112 112
113 // Initializes wallpaper. If logged in, loads user's wallpaper. If not logged
114 // in, uses a solid color wallpaper. If logged in as a stub user, uses an
115 // empty wallpaper.
116 virtual void InitializeWallpaper() = 0;
117
118 // Called when user pod with |email| is selected.
119 virtual void UserSelected(const std::string& email) = 0;
120
121 // Called when browser session is started i.e. after 113 // Called when browser session is started i.e. after
122 // browser_creator.LaunchBrowser(...) was called after user sign in. 114 // browser_creator.LaunchBrowser(...) was called after user sign in.
123 // When user is at the image screen IsUserLoggedIn() will return true 115 // When user is at the image screen IsUserLoggedIn() will return true
124 // but SessionStarted() will return false. 116 // but SessionStarted() will return false.
125 // Fires NOTIFICATION_SESSION_STARTED. 117 // Fires NOTIFICATION_SESSION_STARTED.
126 virtual void SessionStarted() = 0; 118 virtual void SessionStarted() = 0;
127 119
128 // Removes the user from the device. Note, it will verify that the given user 120 // Removes the user from the device. Note, it will verify that the given user
129 // isn't the owner, so calling this method for the owner will take no effect. 121 // isn't the owner, so calling this method for the owner will take no effect.
130 // Note, |delegate| can be NULL. 122 // Note, |delegate| can be NULL.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 // Ignored If there is no such user. 159 // Ignored If there is no such user.
168 virtual void SaveUserDisplayEmail(const std::string& username, 160 virtual void SaveUserDisplayEmail(const std::string& username,
169 const std::string& display_email) = 0; 161 const std::string& display_email) = 0;
170 162
171 // Returns the display email for user |username| if it is known (was 163 // Returns the display email for user |username| if it is known (was
172 // previously set by a |SaveUserDisplayEmail| call). 164 // previously set by a |SaveUserDisplayEmail| call).
173 // Otherwise, returns |username| itself. 165 // Otherwise, returns |username| itself.
174 virtual std::string GetUserDisplayEmail( 166 virtual std::string GetUserDisplayEmail(
175 const std::string& username) const = 0; 167 const std::string& username) const = 0;
176 168
177 // Sets |type| and |index| to the value saved in local state for logged in
178 // user.
179 virtual void GetLoggedInUserWallpaperProperties(User::WallpaperType* type,
180 int* index,
181 base::Time* last_modification_date) = 0;
182
183 // Saves |type| and |index| chose by logged in user to Local State. 169 // Saves |type| and |index| chose by logged in user to Local State.
184 virtual void SaveLoggedInUserWallpaperProperties(User::WallpaperType type, 170 virtual void SaveLoggedInUserWallpaperProperties(User::WallpaperType type,
185 int index) = 0; 171 int index) = 0;
186 172
187 // Sets user image to the default image with index |image_index|, sends 173 // Sets user image to the default image with index |image_index|, sends
188 // LOGIN_USER_IMAGE_CHANGED notification and updates Local State. 174 // LOGIN_USER_IMAGE_CHANGED notification and updates Local State.
189 virtual void SaveUserDefaultImageIndex(const std::string& username, 175 virtual void SaveUserDefaultImageIndex(const std::string& username,
190 int image_index) = 0; 176 int image_index) = 0;
191 177
192 // Saves image to file, sends LOGIN_USER_IMAGE_CHANGED notification and 178 // Saves image to file, sends LOGIN_USER_IMAGE_CHANGED notification and
193 // updates Local State. 179 // updates Local State.
194 virtual void SaveUserImage(const std::string& username, 180 virtual void SaveUserImage(const std::string& username,
195 const UserImage& user_image) = 0; 181 const UserImage& user_image) = 0;
196 182
197 // Updates custom wallpaper to selected layout and saves layout to Local 183 // Updates custom wallpaper to selected layout and saves layout to Local
198 // State. 184 // State.
199 virtual void SetLoggedInUserCustomWallpaperLayout( 185 virtual void SetLoggedInUserCustomWallpaperLayout(
200 ash::WallpaperLayout layout) = 0; 186 ash::WallpaperLayout layout) = 0;
201 187
202 // Tries to load user image from disk; if successful, sets it for the user, 188 // Tries to load user image from disk; if successful, sets it for the user,
203 // sends LOGIN_USER_IMAGE_CHANGED notification and updates Local State. 189 // sends LOGIN_USER_IMAGE_CHANGED notification and updates Local State.
204 virtual void SaveUserImageFromFile(const std::string& username, 190 virtual void SaveUserImageFromFile(const std::string& username,
205 const FilePath& path) = 0; 191 const FilePath& path) = 0;
206 192
207 // Tries to load user image from disk; if successful, sets it for the user,
208 // and updates Local State.
209 virtual void SaveUserWallpaperFromFile(
210 const std::string& username,
211 const FilePath& path,
212 ash::WallpaperLayout layout,
213 base::WeakPtr<WallpaperDelegate> delegate) = 0;
214
215 // Sets profile image as user image for |username|, sends 193 // Sets profile image as user image for |username|, sends
216 // LOGIN_USER_IMAGE_CHANGED notification and updates Local State. If the user 194 // LOGIN_USER_IMAGE_CHANGED notification and updates Local State. If the user
217 // is not logged-in or the last |DownloadProfileImage| call has failed, a 195 // is not logged-in or the last |DownloadProfileImage| call has failed, a
218 // default grey avatar will be used until the user logs in and profile image 196 // default grey avatar will be used until the user logs in and profile image
219 // is downloaded successfully. 197 // is downloaded successfully.
220 virtual void SaveUserImageFromProfileImage(const std::string& username) = 0; 198 virtual void SaveUserImageFromProfileImage(const std::string& username) = 0;
221 199
222 // Starts downloading the profile image for the logged-in user. 200 // Starts downloading the profile image for the logged-in user.
223 // If user's image index is |kProfileImageIndex|, newly downloaded image 201 // If user's image index is |kProfileImageIndex|, newly downloaded image
224 // is immediately set as user's current picture. 202 // is immediately set as user's current picture.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 virtual void NotifyLocalStateChanged() = 0; 236 virtual void NotifyLocalStateChanged() = 0;
259 237
260 // Returns the result of the last successful profile image download, if any. 238 // Returns the result of the last successful profile image download, if any.
261 // Otherwise, returns an empty bitmap. 239 // Otherwise, returns an empty bitmap.
262 virtual const SkBitmap& DownloadedProfileImage() const = 0; 240 virtual const SkBitmap& DownloadedProfileImage() const = 0;
263 }; 241 };
264 242
265 } // namespace chromeos 243 } // namespace chromeos
266 244
267 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ 245 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/user.cc ('k') | chrome/browser/chromeos/login/user_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698