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 "base/memory/singleton.h" | 12 #include "base/memory/singleton.h" |
12 #include "chrome/browser/chromeos/login/user.h" | 13 #include "chrome/browser/chromeos/login/user.h" |
13 | 14 |
14 class SkBitmap; | 15 class SkBitmap; |
15 class FilePath; | 16 class FilePath; |
16 class PrefService; | 17 class PrefService; |
17 | 18 |
18 namespace chromeos { | 19 namespace chromeos { |
19 | 20 |
20 class RemoveUserDelegate; | 21 class RemoveUserDelegate; |
(...skipping 10 matching lines...) Expand all Loading... |
31 virtual void LocalStateChanged(UserManager* user_manager) = 0; | 32 virtual void LocalStateChanged(UserManager* user_manager) = 0; |
32 | 33 |
33 protected: | 34 protected: |
34 virtual ~Observer() {} | 35 virtual ~Observer() {} |
35 }; | 36 }; |
36 | 37 |
37 // A vector pref of the users who have logged into the device. | 38 // A vector pref of the users who have logged into the device. |
38 static const char kLoggedInUsers[]; | 39 static const char kLoggedInUsers[]; |
39 | 40 |
40 // A dictionary that maps usernames to file paths to their wallpapers. | 41 // A dictionary that maps usernames to file paths to their wallpapers. |
| 42 // Deprecated. Will remove this const char after done migration. |
41 static const char kUserWallpapers[]; | 43 static const char kUserWallpapers[]; |
42 | 44 |
| 45 // A dictionary that maps usernames to wallpaper properties. |
| 46 static const char kUserWallpapersProperties[]; |
| 47 |
43 // A dictionary that maps usernames to file paths to their images. | 48 // A dictionary that maps usernames to file paths to their images. |
44 static const char kUserImages[]; | 49 static const char kUserImages[]; |
45 | 50 |
46 // A dictionary that maps usernames to the displayed (non-canonical) emails. | 51 // A dictionary that maps usernames to the displayed (non-canonical) emails. |
47 static const char kUserDisplayEmail[]; | 52 static const char kUserDisplayEmail[]; |
48 | 53 |
49 // A dictionary that maps usernames to OAuth token presence flag. | 54 // A dictionary that maps usernames to OAuth token presence flag. |
50 static const char kUserOAuthTokenStatus[]; | 55 static const char kUserOAuthTokenStatus[]; |
51 | 56 |
52 // Returns a shared instance of a UserManager. Not thread-safe, should only be | 57 // Returns a shared instance of a UserManager. Not thread-safe, should only be |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 const std::string& display_email) = 0; | 146 const std::string& display_email) = 0; |
142 | 147 |
143 // Returns the display email for user |username| if it is known (was | 148 // Returns the display email for user |username| if it is known (was |
144 // previously set by a |SaveUserDisplayEmail| call). | 149 // previously set by a |SaveUserDisplayEmail| call). |
145 // Otherwise, returns |username| itself. | 150 // Otherwise, returns |username| itself. |
146 virtual std::string GetUserDisplayEmail( | 151 virtual std::string GetUserDisplayEmail( |
147 const std::string& username) const = 0; | 152 const std::string& username) const = 0; |
148 | 153 |
149 // Returns the index of the default wallpapers saved in local state for login | 154 // Returns the index of the default wallpapers saved in local state for login |
150 // user if it is known (was previousely set by |SaveWallpaperToLocalState| | 155 // user if it is known (was previousely set by |SaveWallpaperToLocalState| |
151 // call). Otherwise, returns a randomly generated index. | 156 // call). Otherwise, returns the default wallpaper index. |
152 virtual int GetUserWallpaperIndex() = 0; | 157 virtual int GetLoggedInUserWallpaperIndex() = 0; |
153 | 158 |
154 // Save the index |wallpaper_index| of the default wallpapers selected by | 159 // Set |type| and |index| to the value saved in local state for logged in |
155 // current user to Local State. | 160 // user. |
156 virtual void SaveUserWallpaperIndex(int wallpaper_index) = 0; | 161 virtual void GetLoggedInUserWallpaperProperties(User::WallpaperType& type, |
| 162 int& index) = 0; |
| 163 |
| 164 // Save |type| and |index| chose by logged in user to Local State. |
| 165 virtual void SaveLoggedInUserWallpaperProperties(User::WallpaperType type, |
| 166 int index) = 0; |
157 | 167 |
158 // Sets user image to the default image with index |image_index|, sends | 168 // Sets user image to the default image with index |image_index|, sends |
159 // LOGIN_USER_IMAGE_CHANGED notification and updates Local State. | 169 // LOGIN_USER_IMAGE_CHANGED notification and updates Local State. |
160 virtual void SaveUserDefaultImageIndex(const std::string& username, | 170 virtual void SaveUserDefaultImageIndex(const std::string& username, |
161 int image_index) = 0; | 171 int image_index) = 0; |
162 | 172 |
163 // Saves image to file, sends LOGIN_USER_IMAGE_CHANGED notification and | 173 // Saves image to file, sends LOGIN_USER_IMAGE_CHANGED notification and |
164 // updates Local State. | 174 // updates Local State. |
165 virtual void SaveUserImage(const std::string& username, | 175 virtual void SaveUserImage(const std::string& username, |
166 const SkBitmap& image) = 0; | 176 const SkBitmap& image) = 0; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 virtual void NotifyLocalStateChanged() = 0; | 229 virtual void NotifyLocalStateChanged() = 0; |
220 | 230 |
221 // Returns the result of the last successful profile image download, if any. | 231 // Returns the result of the last successful profile image download, if any. |
222 // Otherwise, returns an empty bitmap. | 232 // Otherwise, returns an empty bitmap. |
223 virtual const SkBitmap& DownloadedProfileImage() const = 0; | 233 virtual const SkBitmap& DownloadedProfileImage() const = 0; |
224 }; | 234 }; |
225 | 235 |
226 } // namespace chromeos | 236 } // namespace chromeos |
227 | 237 |
228 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ | 238 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ |
OLD | NEW |