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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "ash/desktop_background/desktop_background_resources.h" | 11 #include "ash/desktop_background/desktop_background_resources.h" |
12 #include "base/memory/singleton.h" | 12 #include "base/memory/singleton.h" |
13 #include "chrome/browser/chromeos/login/user.h" | 13 #include "chrome/browser/chromeos/login/user.h" |
14 #include "chrome/browser/ui/webui/options2/chromeos/set_wallpaper_options_handle
r2.h" | 14 #include "chrome/browser/ui/webui/options2/chromeos/set_wallpaper_options_handle
r2.h" |
15 | 15 |
16 class SkBitmap; | 16 class SkBitmap; |
17 class FilePath; | 17 class FilePath; |
18 class PrefService; | 18 class PrefService; |
19 | 19 |
20 namespace chromeos { | 20 namespace chromeos { |
21 | 21 |
22 class RemoveUserDelegate; | 22 class RemoveUserDelegate; |
| 23 class UserImage; |
23 | 24 |
24 // Base class for UserManagerImpl - provides a mechanism for discovering users | 25 // Base class for UserManagerImpl - provides a mechanism for discovering users |
25 // who have logged into this Chrome OS device before and updating that list. | 26 // who have logged into this Chrome OS device before and updating that list. |
26 class UserManager { | 27 class UserManager { |
27 public: | 28 public: |
28 // Interface that observers of UserManager must implement in order | 29 // Interface that observers of UserManager must implement in order |
29 // to receive notification when local state preferences is changed | 30 // to receive notification when local state preferences is changed |
30 class Observer { | 31 class Observer { |
31 public: | 32 public: |
32 // Called when the local state preferences is changed | 33 // Called when the local state preferences is changed |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 int index) = 0; | 168 int index) = 0; |
168 | 169 |
169 // Sets user image to the default image with index |image_index|, sends | 170 // Sets user image to the default image with index |image_index|, sends |
170 // LOGIN_USER_IMAGE_CHANGED notification and updates Local State. | 171 // LOGIN_USER_IMAGE_CHANGED notification and updates Local State. |
171 virtual void SaveUserDefaultImageIndex(const std::string& username, | 172 virtual void SaveUserDefaultImageIndex(const std::string& username, |
172 int image_index) = 0; | 173 int image_index) = 0; |
173 | 174 |
174 // Saves image to file, sends LOGIN_USER_IMAGE_CHANGED notification and | 175 // Saves image to file, sends LOGIN_USER_IMAGE_CHANGED notification and |
175 // updates Local State. | 176 // updates Local State. |
176 virtual void SaveUserImage(const std::string& username, | 177 virtual void SaveUserImage(const std::string& username, |
177 const SkBitmap& image) = 0; | 178 const UserImage& user_image) = 0; |
178 | 179 |
179 // Updates custom wallpaper to selected layout and saves layout to Local | 180 // Updates custom wallpaper to selected layout and saves layout to Local |
180 // State. | 181 // State. |
181 virtual void SetLoggedInUserCustomWallpaperLayout( | 182 virtual void SetLoggedInUserCustomWallpaperLayout( |
182 ash::WallpaperLayout layout) = 0; | 183 ash::WallpaperLayout layout) = 0; |
183 | 184 |
184 // Tries to load user image from disk; if successful, sets it for the user, | 185 // Tries to load user image from disk; if successful, sets it for the user, |
185 // sends LOGIN_USER_IMAGE_CHANGED notification and updates Local State. | 186 // sends LOGIN_USER_IMAGE_CHANGED notification and updates Local State. |
186 virtual void SaveUserImageFromFile(const std::string& username, | 187 virtual void SaveUserImageFromFile(const std::string& username, |
187 const FilePath& path) = 0; | 188 const FilePath& path) = 0; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 virtual void NotifyLocalStateChanged() = 0; | 240 virtual void NotifyLocalStateChanged() = 0; |
240 | 241 |
241 // Returns the result of the last successful profile image download, if any. | 242 // Returns the result of the last successful profile image download, if any. |
242 // Otherwise, returns an empty bitmap. | 243 // Otherwise, returns an empty bitmap. |
243 virtual const SkBitmap& DownloadedProfileImage() const = 0; | 244 virtual const SkBitmap& DownloadedProfileImage() const = 0; |
244 }; | 245 }; |
245 | 246 |
246 } // namespace chromeos | 247 } // namespace chromeos |
247 | 248 |
248 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ | 249 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ |
OLD | NEW |