Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(319)

Side by Side Diff: components/user_manager/user.h

Issue 2517053004: Use base::RefCountedBytes in user_manager::UserImage (Closed)
Patch Set: remove unnecessary base::move Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 COMPONENTS_USER_MANAGER_USER_H_ 5 #ifndef COMPONENTS_USER_MANAGER_USER_H_
6 #define COMPONENTS_USER_MANAGER_USER_H_ 6 #define COMPONENTS_USER_MANAGER_USER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 // Returns the account name part of the email. Use the display form of the 128 // Returns the account name part of the email. Use the display form of the
129 // email if available and use_display_name == true. Otherwise use canonical. 129 // email if available and use_display_name == true. Otherwise use canonical.
130 std::string GetAccountName(bool use_display_email) const; 130 std::string GetAccountName(bool use_display_email) const;
131 131
132 // Whether the user has a default image. 132 // Whether the user has a default image.
133 bool HasDefaultImage() const; 133 bool HasDefaultImage() const;
134 134
135 int image_index() const { return image_index_; } 135 int image_index() const { return image_index_; }
136 bool has_image_bytes() const { return user_image_->has_image_bytes(); } 136 bool has_image_bytes() const { return user_image_->has_image_bytes(); }
137 // Returns bytes representation of static user image for WebUI. 137 // Returns bytes representation of static user image for WebUI.
138 const UserImage::Bytes& image_bytes() const { 138 scoped_refptr<base::RefCountedBytes> image_bytes() const {
139 return user_image_->image_bytes(); 139 return user_image_->image_bytes();
140 } 140 }
141 141
142 // Whether |user_image_| contains data in format that is considered safe to 142 // Whether |user_image_| contains data in format that is considered safe to
143 // decode in sensitive environment (on Login screen). 143 // decode in sensitive environment (on Login screen).
144 bool image_is_safe_format() const { return user_image_->is_safe_format(); } 144 bool image_is_safe_format() const { return user_image_->is_safe_format(); }
145 145
146 // Returns the URL of user image, if there is any. Currently only the profile 146 // Returns the URL of user image, if there is any. Currently only the profile
147 // image has a URL, for other images empty URL is returned. 147 // image has a URL, for other images empty URL is returned.
148 GURL image_url() const { return user_image_->url(); } 148 GURL image_url() const { return user_image_->url(); }
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 302
303 DISALLOW_COPY_AND_ASSIGN(User); 303 DISALLOW_COPY_AND_ASSIGN(User);
304 }; 304 };
305 305
306 // List of known users. 306 // List of known users.
307 using UserList = std::vector<User*>; 307 using UserList = std::vector<User*>;
308 308
309 } // namespace user_manager 309 } // namespace user_manager
310 310
311 #endif // COMPONENTS_USER_MANAGER_USER_H_ 311 #endif // COMPONENTS_USER_MANAGER_USER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/user_image_source.cc ('k') | components/user_manager/user_image/user_image.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698