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

Side by Side Diff: chrome/browser/chromeos/login/users/user.cc

Issue 376193002: Move UserImage to user_manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 months 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 | Annotate | Revision Log
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 #include "chrome/browser/chromeos/login/users/user.h" 5 #include "chrome/browser/chromeos/login/users/user.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/threading/thread_restrictions.h" 10 #include "base/threading/thread_restrictions.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 is_active_(false), 202 is_active_(false),
203 profile_is_created_(false) { 203 profile_is_created_(false) {
204 } 204 }
205 205
206 User::~User() {} 206 User::~User() {}
207 207
208 void User::SetAccountLocale(const std::string& resolved_account_locale) { 208 void User::SetAccountLocale(const std::string& resolved_account_locale) {
209 account_locale_.reset(new std::string(resolved_account_locale)); 209 account_locale_.reset(new std::string(resolved_account_locale));
210 } 210 }
211 211
212 void User::SetImage(const UserImage& user_image, int image_index) { 212 void User::SetImage(const user_manager::UserImage& user_image,
213 int image_index) {
213 user_image_ = user_image; 214 user_image_ = user_image;
214 image_index_ = image_index; 215 image_index_ = image_index;
215 image_is_stub_ = false; 216 image_is_stub_ = false;
216 image_is_loading_ = false; 217 image_is_loading_ = false;
217 DCHECK(HasDefaultImage() || user_image.has_raw_image()); 218 DCHECK(HasDefaultImage() || user_image.has_raw_image());
218 } 219 }
219 220
220 void User::SetImageURL(const GURL& image_url) { 221 void User::SetImageURL(const GURL& image_url) {
221 user_image_.set_url(image_url); 222 user_image_.set_url(image_url);
222 } 223 }
223 224
224 void User::SetStubImage(int image_index, bool is_loading) { 225 void User::SetStubImage(int image_index, bool is_loading) {
225 user_image_ = UserImage( 226 user_image_ = user_manager::UserImage(
226 *ResourceBundle::GetSharedInstance(). 227 *ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
227 GetImageSkiaNamed(IDR_PROFILE_PICTURE_LOADING)); 228 IDR_PROFILE_PICTURE_LOADING));
228 image_index_ = image_index; 229 image_index_ = image_index;
229 image_is_stub_ = true; 230 image_is_stub_ = true;
230 image_is_loading_ = is_loading; 231 image_is_loading_ = is_loading;
231 } 232 }
232 233
233 RegularUser::RegularUser(const std::string& email) : User(email) { 234 RegularUser::RegularUser(const std::string& email) : User(email) {
234 set_can_lock(true); 235 set_can_lock(true);
235 set_display_email(email); 236 set_display_email(email);
236 } 237 }
237 238
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 case user_manager::USER_TYPE_LOCALLY_MANAGED: 312 case user_manager::USER_TYPE_LOCALLY_MANAGED:
312 case user_manager::USER_TYPE_KIOSK_APP: 313 case user_manager::USER_TYPE_KIOSK_APP:
313 return false; 314 return false;
314 default: 315 default:
315 NOTREACHED(); 316 NOTREACHED();
316 } 317 }
317 return false; 318 return false;
318 } 319 }
319 320
320 } // namespace chromeos 321 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698