Index: chrome/browser/ui/webui/options/chromeos/user_image_source.cc |
diff --git a/chrome/browser/ui/webui/options/chromeos/user_image_source.cc b/chrome/browser/ui/webui/options/chromeos/user_image_source.cc |
index a5c0a62b9ea29ca27b415d9ca6e5e6124ed329ff..54b1b46c81672fba5a64d2e328b2d7174d6546d1 100644 |
--- a/chrome/browser/ui/webui/options/chromeos/user_image_source.cc |
+++ b/chrome/browser/ui/webui/options/chromeos/user_image_source.cc |
@@ -19,31 +19,15 @@ |
namespace { |
-// Animated key is used in user image URL requests to specify that |
-// animated version of user image is required. Without that key |
-// non-animated version of user image should be returned. |
-const char kKeyAnimated[] = "animated"; |
- |
// Parses the user image URL, which looks like |
// "chrome://userimage/user@host?key1=value1&...&key_n=value_n", |
-// to user email and optional parameters. |
+// to user email. |
void ParseRequest(const GURL& url, |
- std::string* email, |
- bool* is_image_animated) { |
+ std::string* email) { |
DCHECK(url.is_valid()); |
*email = net::UnescapeURLComponent(url.path().substr(1), |
(net::UnescapeRule::URL_SPECIAL_CHARS | |
net::UnescapeRule::SPACES)); |
- std::string url_spec = url.possibly_invalid_spec(); |
- url::Component query = url.parsed_for_possibly_invalid_spec().query; |
- url::Component key, value; |
- *is_image_animated = false; |
- while (ExtractQueryKeyValue(url_spec.c_str(), &query, &key, &value)) { |
- if (url_spec.substr(key.begin, key.len) == kKeyAnimated) { |
- *is_image_animated = true; |
- break; |
- } |
- } |
} |
} // namespace |
@@ -53,14 +37,11 @@ namespace options { |
base::RefCountedMemory* UserImageSource::GetUserImage( |
const std::string& email, |
- bool is_image_animated, |
ui::ScaleFactor scale_factor) const { |
const user_manager::User* user = |
chromeos::UserManager::Get()->FindUser(email); |
if (user) { |
- if (user->has_animated_image() && is_image_animated) { |
- return new base::RefCountedBytes(user->animated_image()); |
- } else if (user->has_raw_image()) { |
+ if (user->has_raw_image()) { |
return new base::RefCountedBytes(user->raw_image()); |
} else if (user->image_is_stub()) { |
return ResourceBundle::GetSharedInstance(). |
@@ -94,27 +75,14 @@ void UserImageSource::StartDataRequest( |
int render_frame_id, |
const content::URLDataSource::GotDataCallback& callback) { |
std::string email; |
- bool is_image_animated = false; |
GURL url(chrome::kChromeUIUserImageURL + path); |
- ParseRequest(url, &email, &is_image_animated); |
- callback.Run(GetUserImage(email, is_image_animated, ui::SCALE_FACTOR_100P)); |
+ ParseRequest(url, &email); |
+ callback.Run(GetUserImage(email, ui::SCALE_FACTOR_100P)); |
} |
std::string UserImageSource::GetMimeType(const std::string& path) const { |
// We need to explicitly return a mime type, otherwise if the user tries to |
// drag the image they get no extension. |
- std::string email; |
- bool is_image_animated = false; |
- |
- GURL url(chrome::kChromeUIUserImageURL + path); |
- ParseRequest(url, &email, &is_image_animated); |
- |
- if (is_image_animated) { |
- const user_manager::User* user = |
- chromeos::UserManager::Get()->FindUser(email); |
- if (user && user->has_animated_image()) |
- return "image/gif"; |
- } |
return "image/png"; |
} |