Index: chrome/browser/profiles/profile_avatar_downloader.cc |
diff --git a/chrome/browser/profiles/profile_avatar_downloader.cc b/chrome/browser/profiles/profile_avatar_downloader.cc |
index f00dc76122dbc4e04d42a010664575c34a58d431..c3a98558f86c0405ceb89971b903724761aec222 100644 |
--- a/chrome/browser/profiles/profile_avatar_downloader.cc |
+++ b/chrome/browser/profiles/profile_avatar_downloader.cc |
@@ -22,6 +22,12 @@ ProfileAvatarDownloader::ProfileAvatarDownloader( |
ProfileInfoCache* cache) |
: icon_index_(icon_index), |
profile_path_(profile_path), |
+ // The downloader should only execute on desktop platforms. |
+#if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) && !defined(OS_IOS) |
+ downloader_active_(true), |
+#else |
+ downloader_active_(false), |
+#endif |
cache_(cache) { |
GURL url(std::string(kHighResAvatarDownloadUrlPrefix) + |
profiles::GetDefaultAvatarIconFileNameAtIndex(icon_index)); |
@@ -32,6 +38,9 @@ ProfileAvatarDownloader::~ProfileAvatarDownloader() { |
} |
void ProfileAvatarDownloader::Start() { |
+ if (!downloader_active_) |
+ return; |
+ |
// In unit tests, the browser process can return a NULL request context. |
net::URLRequestContextGetter* request_context = |
g_browser_process->system_request_context(); |
@@ -46,7 +55,7 @@ void ProfileAvatarDownloader::Start() { |
// BitmapFetcherDelegate overrides. |
void ProfileAvatarDownloader::OnFetchComplete(const GURL url, |
const SkBitmap* bitmap) { |
- if (!bitmap || !cache_) |
+ if (!bitmap || !cache_ || !downloader_active_) |
return; |
// Decode the downloaded bitmap. Ownership of the image is taken by |cache_|. |