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_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // Returns raw representation of static user image. | 67 // Returns raw representation of static user image. |
68 const UserImage::RawImage& raw_image() const { | 68 const UserImage::RawImage& raw_image() const { |
69 return user_image_.raw_image(); | 69 return user_image_.raw_image(); |
70 } | 70 } |
71 bool has_animated_image() const { return user_image_.has_animated_image(); } | 71 bool has_animated_image() const { return user_image_.has_animated_image(); } |
72 // Returns raw representation of animated user image. | 72 // Returns raw representation of animated user image. |
73 const UserImage::RawImage& animated_image() const { | 73 const UserImage::RawImage& animated_image() const { |
74 return user_image_.animated_image(); | 74 return user_image_.animated_image(); |
75 } | 75 } |
76 | 76 |
| 77 // Returns the URL of user image, if there is any. Currently only the profile |
| 78 // image has a URL, for other images empty URL is returned. |
| 79 GURL image_url() const { return user_image_.url(); } |
| 80 |
77 // The thumbnail of user custom wallpaper. | 81 // The thumbnail of user custom wallpaper. |
78 const SkBitmap& wallpaper_thumbnail() const { return wallpaper_thumbnail_; } | 82 const SkBitmap& wallpaper_thumbnail() const { return wallpaper_thumbnail_; } |
79 | 83 |
80 // True if user image is a stub (while real image is being loaded from file). | 84 // True if user image is a stub (while real image is being loaded from file). |
81 bool image_is_stub() const { return image_is_stub_; } | 85 bool image_is_stub() const { return image_is_stub_; } |
82 | 86 |
83 // OAuth token status for this user. | 87 // OAuth token status for this user. |
84 OAuthTokenStatus oauth_token_status() const { return oauth_token_status_; } | 88 OAuthTokenStatus oauth_token_status() const { return oauth_token_status_; } |
85 | 89 |
86 // The displayed user name. | 90 // The displayed user name. |
(...skipping 10 matching lines...) Expand all Loading... |
97 friend class MockUserManager; | 101 friend class MockUserManager; |
98 friend class UserManagerTest; | 102 friend class UserManagerTest; |
99 | 103 |
100 // Do not allow anyone else to create new User instances. | 104 // Do not allow anyone else to create new User instances. |
101 User(const std::string& email, bool is_guest); | 105 User(const std::string& email, bool is_guest); |
102 ~User(); | 106 ~User(); |
103 | 107 |
104 // Setters are private so only UserManager can call them. | 108 // Setters are private so only UserManager can call them. |
105 void SetImage(const UserImage& user_image, int image_index); | 109 void SetImage(const UserImage& user_image, int image_index); |
106 | 110 |
| 111 void SetImageURL(const GURL& image_url); |
| 112 |
107 // Sets a stub image until the next |SetImage| call. |image_index| may be | 113 // Sets a stub image until the next |SetImage| call. |image_index| may be |
108 // one of |kExternalImageIndex| or |kProfileImageIndex|. | 114 // one of |kExternalImageIndex| or |kProfileImageIndex|. |
109 void SetStubImage(int image_index); | 115 void SetStubImage(int image_index); |
110 | 116 |
111 // Set thumbnail of user custom wallpaper. | 117 // Set thumbnail of user custom wallpaper. |
112 void SetWallpaperThumbnail(const SkBitmap& wallpaper_thumbnail); | 118 void SetWallpaperThumbnail(const SkBitmap& wallpaper_thumbnail); |
113 | 119 |
114 void set_oauth_token_status(OAuthTokenStatus status) { | 120 void set_oauth_token_status(OAuthTokenStatus status) { |
115 oauth_token_status_ = status; | 121 oauth_token_status_ = status; |
116 } | 122 } |
(...skipping 29 matching lines...) Expand all Loading... |
146 | 152 |
147 DISALLOW_COPY_AND_ASSIGN(User); | 153 DISALLOW_COPY_AND_ASSIGN(User); |
148 }; | 154 }; |
149 | 155 |
150 // List of known users. | 156 // List of known users. |
151 typedef std::vector<User*> UserList; | 157 typedef std::vector<User*> UserList; |
152 | 158 |
153 } // namespace chromeos | 159 } // namespace chromeos |
154 | 160 |
155 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_H_ | 161 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_H_ |
OLD | NEW |