| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 int index) = 0; | 179 int index) = 0; |
| 179 | 180 |
| 180 // Sets user image to the default image with index |image_index|, sends | 181 // Sets user image to the default image with index |image_index|, sends |
| 181 // LOGIN_USER_IMAGE_CHANGED notification and updates Local State. | 182 // LOGIN_USER_IMAGE_CHANGED notification and updates Local State. |
| 182 virtual void SaveUserDefaultImageIndex(const std::string& username, | 183 virtual void SaveUserDefaultImageIndex(const std::string& username, |
| 183 int image_index) = 0; | 184 int image_index) = 0; |
| 184 | 185 |
| 185 // Saves image to file, sends LOGIN_USER_IMAGE_CHANGED notification and | 186 // Saves image to file, sends LOGIN_USER_IMAGE_CHANGED notification and |
| 186 // updates Local State. | 187 // updates Local State. |
| 187 virtual void SaveUserImage(const std::string& username, | 188 virtual void SaveUserImage(const std::string& username, |
| 188 const SkBitmap& image) = 0; | 189 const UserImage& user_image) = 0; |
| 189 | 190 |
| 190 // Updates custom wallpaper to selected layout and saves layout to Local | 191 // Updates custom wallpaper to selected layout and saves layout to Local |
| 191 // State. | 192 // State. |
| 192 virtual void SetLoggedInUserCustomWallpaperLayout( | 193 virtual void SetLoggedInUserCustomWallpaperLayout( |
| 193 ash::WallpaperLayout layout) = 0; | 194 ash::WallpaperLayout layout) = 0; |
| 194 | 195 |
| 195 // Tries to load user image from disk; if successful, sets it for the user, | 196 // Tries to load user image from disk; if successful, sets it for the user, |
| 196 // sends LOGIN_USER_IMAGE_CHANGED notification and updates Local State. | 197 // sends LOGIN_USER_IMAGE_CHANGED notification and updates Local State. |
| 197 virtual void SaveUserImageFromFile(const std::string& username, | 198 virtual void SaveUserImageFromFile(const std::string& username, |
| 198 const FilePath& path) = 0; | 199 const FilePath& path) = 0; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 virtual void NotifyLocalStateChanged() = 0; | 251 virtual void NotifyLocalStateChanged() = 0; |
| 251 | 252 |
| 252 // Returns the result of the last successful profile image download, if any. | 253 // Returns the result of the last successful profile image download, if any. |
| 253 // Otherwise, returns an empty bitmap. | 254 // Otherwise, returns an empty bitmap. |
| 254 virtual const SkBitmap& DownloadedProfileImage() const = 0; | 255 virtual const SkBitmap& DownloadedProfileImage() const = 0; |
| 255 }; | 256 }; |
| 256 | 257 |
| 257 } // namespace chromeos | 258 } // namespace chromeos |
| 258 | 259 |
| 259 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ | 260 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ |
| OLD | NEW |