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

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

Issue 10832019: Speed up custom wallpaper switching time and wallpaper manager code refactor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests Created 8 years, 4 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 (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 #include "chrome/browser/chromeos/login/user.h" 5 #include "chrome/browser/chromeos/login/user.h"
6 6
7 #include "base/stringprintf.h" 7 #include "base/stringprintf.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/chromeos/login/default_user_images.h" 9 #include "chrome/browser/chromeos/login/default_user_images.h"
10 #include "chrome/browser/chromeos/login/user_manager.h" 10 #include "chrome/browser/chromeos/login/user_manager.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 void User::SetImageURL(const GURL& image_url) { 52 void User::SetImageURL(const GURL& image_url) {
53 user_image_.set_url(image_url); 53 user_image_.set_url(image_url);
54 } 54 }
55 55
56 void User::SetStubImage(int image_index) { 56 void User::SetStubImage(int image_index) {
57 user_image_ = UserImage(); 57 user_image_ = UserImage();
58 image_index_ = image_index; 58 image_index_ = image_index;
59 image_is_stub_ = true; 59 image_is_stub_ = true;
60 } 60 }
61 61
62 void User::SetWallpaperThumbnail(const SkBitmap& wallpaper_thumbnail) {
63 wallpaper_thumbnail_ = wallpaper_thumbnail;
64 }
65
66 std::string User::GetAccountName(bool use_display_email) const { 62 std::string User::GetAccountName(bool use_display_email) const {
67 if (use_display_email && !display_email_.empty()) 63 if (use_display_email && !display_email_.empty())
68 return GetUserName(display_email_); 64 return GetUserName(display_email_);
69 else 65 else
70 return GetUserName(email_); 66 return GetUserName(email_);
71 } 67 }
72 68
73 string16 User::GetDisplayName() const { 69 string16 User::GetDisplayName() const {
74 // Fallback to the email account name in case display name haven't been set. 70 // Fallback to the email account name in case display name haven't been set.
75 return display_name_.empty() ? 71 return display_name_.empty() ?
76 UTF8ToUTF16(GetAccountName(true)) : 72 UTF8ToUTF16(GetAccountName(true)) :
77 display_name_; 73 display_name_;
78 } 74 }
79 75
80 } // namespace chromeos 76 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698