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

Unified Diff: chrome/browser/chromeos/login/user.cc

Issue 8822015: [cros] Profile image downloader is always reset after a download. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments added. Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/login/user.h ('k') | chrome/browser/chromeos/login/user_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/user.cc
diff --git a/chrome/browser/chromeos/login/user.cc b/chrome/browser/chromeos/login/user.cc
index 322ec0624068d4c32613d279db0d52cdeb981de0..743f57b1c064a412c29f8bd5e1dbb16da7fcfb24 100644
--- a/chrome/browser/chromeos/login/user.cc
+++ b/chrome/browser/chromeos/login/user.cc
@@ -7,15 +7,24 @@
#include "base/stringprintf.h"
#include "chrome/browser/chromeos/login/default_user_images.h"
#include "chrome/browser/chromeos/login/user_manager.h"
+#include "grit/theme_resources.h"
#include "ui/base/resource/resource_bundle.h"
namespace chromeos {
+namespace {
+
+// Resource ID of the image to use as stub image.
+const int kStubImageResourceID = IDR_PROFILE_PICTURE_LOADING;
+
+} // namespace
+
User::User(const std::string& email)
: email_(email),
display_email_(email),
oauth_token_status_(OAUTH_TOKEN_STATUS_UNKNOWN),
- image_index_(kInvalidImageIndex) {
+ image_index_(kInvalidImageIndex),
+ image_is_stub_(false) {
image_ = *ResourceBundle::GetSharedInstance().GetBitmapNamed(
kDefaultImageResources[0]);
}
@@ -25,6 +34,14 @@ User::~User() {}
void User::SetImage(const SkBitmap& image, int image_index) {
image_ = image;
image_index_ = image_index;
+ image_is_stub_ = false;
+}
+
+void User::SetStubImage(int image_index) {
+ image_ = *ResourceBundle::GetSharedInstance().
+ GetBitmapNamed(kStubImageResourceID);
+ image_index_ = image_index;
+ image_is_stub_ = true;
}
std::string User::GetDisplayName() const {
« no previous file with comments | « chrome/browser/chromeos/login/user.h ('k') | chrome/browser/chromeos/login/user_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698