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

Unified Diff: chrome/browser/profiles/profile_avatar_downloader.h

Issue 222313005: [Profiles] Download high-res avatars using the --new-profile-management flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/profile_avatar_downloader.h
diff --git a/chrome/browser/profiles/profile_avatar_downloader.h b/chrome/browser/profiles/profile_avatar_downloader.h
new file mode 100644
index 0000000000000000000000000000000000000000..8659142684b1dcf6afef3dd3e7ee7537b1fa87fe
--- /dev/null
+++ b/chrome/browser/profiles/profile_avatar_downloader.h
@@ -0,0 +1,42 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+#ifndef CHROME_BROWSER_PROFILES_PROFILE_AVATAR_DOWNLOADER_H_
+#define CHROME_BROWSER_PROFILES_PROFILE_AVATAR_DOWNLOADER_H_
+
+#include "chrome/browser/bitmap_fetcher.h"
+#include "net/url_request/url_request_context_getter.h"
+
+namespace net {
+class URLRequestContextGetter;
+}
+
+class ProfileInfoCache;
+
+class ProfileAvatarDownloader : public chrome::BitmapFetcherDelegate {
+ public:
+ ProfileAvatarDownloader(net::URLRequestContextGetter* request_context,
+ size_t icon_index,
+ ProfileInfoCache* cache);
+
+ virtual ~ProfileAvatarDownloader();
+
+ void Start();
+
+ // BitmapFetcherDelegate:
+ virtual void OnFetchComplete(const GURL url, const SkBitmap* bitmap) OVERRIDE;
+
+ private:
+ // Downloads the avatar image from a url.
+ scoped_ptr<chrome::BitmapFetcher> fetcher_;
+
+ // Needed by the BitmapFetcher to instantiate a URL fetcher.
+ net::URLRequestContextGetter* request_context_;
+
+ // Index of the avatar being downloaded.
+ size_t icon_index_;
+
+ ProfileInfoCache* cache_; // Weak.
+};
+
+#endif // CHROME_BROWSER_PROFILES_PROFILE_AVATAR_DOWNLOADER_H_

Powered by Google App Engine
This is Rietveld 408576698