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 |
(...skipping 19 matching lines...) Expand all Loading... |
30 // Called when the local state preferences is changed | 30 // Called when the local state preferences is changed |
31 virtual void LocalStateChanged(UserManager* user_manager) = 0; | 31 virtual void LocalStateChanged(UserManager* user_manager) = 0; |
32 | 32 |
33 protected: | 33 protected: |
34 virtual ~Observer() {} | 34 virtual ~Observer() {} |
35 }; | 35 }; |
36 | 36 |
37 // A vector pref of the users who have logged into the device. | 37 // A vector pref of the users who have logged into the device. |
38 static const char kLoggedInUsers[]; | 38 static const char kLoggedInUsers[]; |
39 | 39 |
| 40 // A dictionary that maps usernames to file paths to their wallpapers. |
| 41 static const char kUserWallpapers[]; |
| 42 |
40 // A dictionary that maps usernames to file paths to their images. | 43 // A dictionary that maps usernames to file paths to their images. |
41 static const char kUserImages[]; | 44 static const char kUserImages[]; |
42 | 45 |
43 // A dictionary that maps usernames to the displayed (non-canonical) emails. | 46 // A dictionary that maps usernames to the displayed (non-canonical) emails. |
44 static const char kUserDisplayEmail[]; | 47 static const char kUserDisplayEmail[]; |
45 | 48 |
46 // A dictionary that maps usernames to OAuth token presence flag. | 49 // A dictionary that maps usernames to OAuth token presence flag. |
47 static const char kUserOAuthTokenStatus[]; | 50 static const char kUserOAuthTokenStatus[]; |
48 | 51 |
49 // Returns a shared instance of a UserManager. Not thread-safe, should only be | 52 // Returns a shared instance of a UserManager. Not thread-safe, should only be |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 // Ignored If there is no such user. | 107 // Ignored If there is no such user. |
105 virtual void SaveUserDisplayEmail(const std::string& username, | 108 virtual void SaveUserDisplayEmail(const std::string& username, |
106 const std::string& display_email) = 0; | 109 const std::string& display_email) = 0; |
107 | 110 |
108 // Returns the display email for user |username| if it is known (was | 111 // Returns the display email for user |username| if it is known (was |
109 // previously set by a |SaveUserDisplayEmail| call). | 112 // previously set by a |SaveUserDisplayEmail| call). |
110 // Otherwise, returns |username| itself. | 113 // Otherwise, returns |username| itself. |
111 virtual std::string GetUserDisplayEmail( | 114 virtual std::string GetUserDisplayEmail( |
112 const std::string& username) const = 0; | 115 const std::string& username) const = 0; |
113 | 116 |
| 117 // Returns the index of the default wallpapers saved in local state for user |
| 118 // |username| if it is known (was previousely set by |
| 119 // |SaveWallpaperToLocalState| call). |
| 120 // Otherwise, returns default wallpaper index. |
| 121 virtual int GetUserWallpaper(const std::string& username) = 0; |
| 122 |
| 123 // Sets user wallpaper to the default wallpaper with index |wallpaper_index|, |
| 124 // sends DESKTOP_BACKGROUND_CHANGED notification and updates Local State. |
| 125 virtual void SaveWallpaperDefaultIndex(const std::string& username, |
| 126 int wallpaper_index) = 0; |
| 127 |
114 // Sets user image to the default image with index |image_index|, sends | 128 // Sets user image to the default image with index |image_index|, sends |
115 // LOGIN_USER_IMAGE_CHANGED notification and updates Local State. | 129 // LOGIN_USER_IMAGE_CHANGED notification and updates Local State. |
116 virtual void SaveUserDefaultImageIndex(const std::string& username, | 130 virtual void SaveUserDefaultImageIndex(const std::string& username, |
117 int image_index) = 0; | 131 int image_index) = 0; |
118 | 132 |
119 // Saves image to file, sends LOGIN_USER_IMAGE_CHANGED notification and | 133 // Saves image to file, sends LOGIN_USER_IMAGE_CHANGED notification and |
120 // updates Local State. | 134 // updates Local State. |
121 virtual void SaveUserImage(const std::string& username, | 135 virtual void SaveUserImage(const std::string& username, |
122 const SkBitmap& image) = 0; | 136 const SkBitmap& image) = 0; |
123 | 137 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 virtual void NotifyLocalStateChanged() = 0; | 174 virtual void NotifyLocalStateChanged() = 0; |
161 | 175 |
162 // Returns the result of the last successful profile image download, if any. | 176 // Returns the result of the last successful profile image download, if any. |
163 // Otherwise, returns an empty bitmap. | 177 // Otherwise, returns an empty bitmap. |
164 virtual const SkBitmap& downloaded_profile_image() const = 0; | 178 virtual const SkBitmap& downloaded_profile_image() const = 0; |
165 }; | 179 }; |
166 | 180 |
167 } // namespace chromeos | 181 } // namespace chromeos |
168 | 182 |
169 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ | 183 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ |
OLD | NEW |