OLD | NEW |
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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 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 | 114 // in, uses a solid color wallpaper. If logged in as a stub user, uses an |
115 // empty wallpaper. | 115 // empty wallpaper. |
116 virtual void InitializeWallpaper() = 0; | 116 virtual void InitializeWallpaper() = 0; |
117 | 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 | 118 // Called when browser session is started i.e. after |
122 // browser_creator.LaunchBrowser(...) was called after user sign in. | 119 // browser_creator.LaunchBrowser(...) was called after user sign in. |
123 // When user is at the image screen IsUserLoggedIn() will return true | 120 // When user is at the image screen IsUserLoggedIn() will return true |
124 // but SessionStarted() will return false. | 121 // but SessionStarted() will return false. |
125 // Fires NOTIFICATION_SESSION_STARTED. | 122 // Fires NOTIFICATION_SESSION_STARTED. |
126 virtual void SessionStarted() = 0; | 123 virtual void SessionStarted() = 0; |
127 | 124 |
128 // Removes the user from the device. Note, it will verify that the given user | 125 // 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. | 126 // isn't the owner, so calling this method for the owner will take no effect. |
130 // Note, |delegate| can be NULL. | 127 // Note, |delegate| can be NULL. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 // Ignored If there is no such user. | 164 // Ignored If there is no such user. |
168 virtual void SaveUserDisplayEmail(const std::string& username, | 165 virtual void SaveUserDisplayEmail(const std::string& username, |
169 const std::string& display_email) = 0; | 166 const std::string& display_email) = 0; |
170 | 167 |
171 // Returns the display email for user |username| if it is known (was | 168 // Returns the display email for user |username| if it is known (was |
172 // previously set by a |SaveUserDisplayEmail| call). | 169 // previously set by a |SaveUserDisplayEmail| call). |
173 // Otherwise, returns |username| itself. | 170 // Otherwise, returns |username| itself. |
174 virtual std::string GetUserDisplayEmail( | 171 virtual std::string GetUserDisplayEmail( |
175 const std::string& username) const = 0; | 172 const std::string& username) const = 0; |
176 | 173 |
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. | 174 // Saves |type| and |index| chose by logged in user to Local State. |
184 virtual void SaveLoggedInUserWallpaperProperties(User::WallpaperType type, | 175 virtual void SaveLoggedInUserWallpaperProperties(User::WallpaperType type, |
185 int index) = 0; | 176 int index) = 0; |
186 | 177 |
187 // Sets user image to the default image with index |image_index|, sends | 178 // Sets user image to the default image with index |image_index|, sends |
188 // LOGIN_USER_IMAGE_CHANGED notification and updates Local State. | 179 // LOGIN_USER_IMAGE_CHANGED notification and updates Local State. |
189 virtual void SaveUserDefaultImageIndex(const std::string& username, | 180 virtual void SaveUserDefaultImageIndex(const std::string& username, |
190 int image_index) = 0; | 181 int image_index) = 0; |
191 | 182 |
192 // Saves image to file, sends LOGIN_USER_IMAGE_CHANGED notification and | 183 // Saves image to file, sends LOGIN_USER_IMAGE_CHANGED notification and |
193 // updates Local State. | 184 // updates Local State. |
194 virtual void SaveUserImage(const std::string& username, | 185 virtual void SaveUserImage(const std::string& username, |
195 const UserImage& user_image) = 0; | 186 const UserImage& user_image) = 0; |
196 | 187 |
197 // Updates custom wallpaper to selected layout and saves layout to Local | 188 // Updates custom wallpaper to selected layout and saves layout to Local |
198 // State. | 189 // State. |
199 virtual void SetLoggedInUserCustomWallpaperLayout( | 190 virtual void SetLoggedInUserCustomWallpaperLayout( |
200 ash::WallpaperLayout layout) = 0; | 191 ash::WallpaperLayout layout) = 0; |
201 | 192 |
202 // Tries to load user image from disk; if successful, sets it for the user, | 193 // 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. | 194 // sends LOGIN_USER_IMAGE_CHANGED notification and updates Local State. |
204 virtual void SaveUserImageFromFile(const std::string& username, | 195 virtual void SaveUserImageFromFile(const std::string& username, |
205 const FilePath& path) = 0; | 196 const FilePath& path) = 0; |
206 | 197 |
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 | 198 // Sets profile image as user image for |username|, sends |
216 // LOGIN_USER_IMAGE_CHANGED notification and updates Local State. If the user | 199 // 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 | 200 // 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 | 201 // default grey avatar will be used until the user logs in and profile image |
219 // is downloaded successfully. | 202 // is downloaded successfully. |
220 virtual void SaveUserImageFromProfileImage(const std::string& username) = 0; | 203 virtual void SaveUserImageFromProfileImage(const std::string& username) = 0; |
221 | 204 |
222 // Starts downloading the profile image for the logged-in user. | 205 // Starts downloading the profile image for the logged-in user. |
223 // If user's image index is |kProfileImageIndex|, newly downloaded image | 206 // If user's image index is |kProfileImageIndex|, newly downloaded image |
224 // is immediately set as user's current picture. | 207 // is immediately set as user's current picture. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 virtual void NotifyLocalStateChanged() = 0; | 241 virtual void NotifyLocalStateChanged() = 0; |
259 | 242 |
260 // Returns the result of the last successful profile image download, if any. | 243 // Returns the result of the last successful profile image download, if any. |
261 // Otherwise, returns an empty bitmap. | 244 // Otherwise, returns an empty bitmap. |
262 virtual const SkBitmap& DownloadedProfileImage() const = 0; | 245 virtual const SkBitmap& DownloadedProfileImage() const = 0; |
263 }; | 246 }; |
264 | 247 |
265 } // namespace chromeos | 248 } // namespace chromeos |
266 | 249 |
267 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ | 250 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ |
OLD | NEW |