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

Side by Side Diff: chrome/browser/ui/webui/options2/chromeos/user_image_source.cc

Issue 10850036: [cros] Add attribution (author & website) strings to stock user images. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge 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
« no previous file with comments | « chrome/browser/ui/webui/options2/chromeos/change_picture_options_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ui/webui/options2/chromeos/user_image_source.h" 5 #include "chrome/browser/ui/webui/options2/chromeos/user_image_source.h"
6 6
7 #include "base/memory/ref_counted_memory.h" 7 #include "base/memory/ref_counted_memory.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/string_split.h" 9 #include "base/string_split.h"
10 #include "chrome/browser/chromeos/login/default_user_images.h" 10 #include "chrome/browser/chromeos/login/default_user_images.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 bool is_image_animated, 68 bool is_image_animated,
69 ui::ScaleFactor scale_factor) const { 69 ui::ScaleFactor scale_factor) const {
70 const chromeos::User* user = chromeos::UserManager::Get()->FindUser(email); 70 const chromeos::User* user = chromeos::UserManager::Get()->FindUser(email);
71 if (user) { 71 if (user) {
72 if (user->has_animated_image() && is_image_animated) { 72 if (user->has_animated_image() && is_image_animated) {
73 return new base::RefCountedBytes(user->animated_image()); 73 return new base::RefCountedBytes(user->animated_image());
74 } else if (user->has_raw_image()) { 74 } else if (user->has_raw_image()) {
75 return new base::RefCountedBytes(user->raw_image()); 75 return new base::RefCountedBytes(user->raw_image());
76 } else if (user->HasDefaultImage()) { 76 } else if (user->HasDefaultImage()) {
77 return ResourceBundle::GetSharedInstance(). 77 return ResourceBundle::GetSharedInstance().
78 LoadDataResourceBytes(kDefaultImageResources[user->image_index()], 78 LoadDataResourceBytes(kDefaultImageResourceIDs[user->image_index()],
79 scale_factor); 79 scale_factor);
80 } else { 80 } else {
81 NOTREACHED() << "User with custom image missing raw data"; 81 NOTREACHED() << "User with custom image missing raw data";
82 } 82 }
83 } 83 }
84 return ResourceBundle::GetSharedInstance(). 84 return ResourceBundle::GetSharedInstance().
85 LoadDataResourceBytes(IDR_LOGIN_DEFAULT_USER, scale_factor); 85 LoadDataResourceBytes(IDR_LOGIN_DEFAULT_USER, scale_factor);
86 } 86 }
87 87
88 UserImageSource::UserImageSource() 88 UserImageSource::UserImageSource()
(...skipping 27 matching lines...) Expand all
116 if (is_image_animated) { 116 if (is_image_animated) {
117 const chromeos::User* user = chromeos::UserManager::Get()->FindUser(email); 117 const chromeos::User* user = chromeos::UserManager::Get()->FindUser(email);
118 if (user && user->has_animated_image()) 118 if (user && user->has_animated_image())
119 return "image/gif"; 119 return "image/gif";
120 } 120 }
121 return "image/png"; 121 return "image/png";
122 } 122 }
123 123
124 } // namespace options2 124 } // namespace options2
125 } // namespace chromeos 125 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options2/chromeos/change_picture_options_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698