OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 #ifndef CHROME_BROWSER_PROFILES_PROFILE_AVATAR_DOWNLOADER_H_ |
| 5 #define CHROME_BROWSER_PROFILES_PROFILE_AVATAR_DOWNLOADER_H_ |
| 6 |
| 7 #include "chrome/browser/bitmap_fetcher.h" |
| 8 #include "net/url_request/url_request_context_getter.h" |
| 9 |
| 10 namespace net { |
| 11 class URLRequestContextGetter; |
| 12 } |
| 13 |
| 14 class ProfileInfoCache; |
| 15 |
| 16 class ProfileAvatarDownloader : public chrome::BitmapFetcherDelegate { |
| 17 public: |
| 18 ProfileAvatarDownloader(net::URLRequestContextGetter* request_context, |
| 19 size_t icon_index, |
| 20 ProfileInfoCache* cache); |
| 21 |
| 22 virtual ~ProfileAvatarDownloader(); |
| 23 |
| 24 void Start(); |
| 25 |
| 26 // BitmapFetcherDelegate: |
| 27 virtual void OnFetchComplete(const GURL url, const SkBitmap* bitmap) OVERRIDE; |
| 28 |
| 29 private: |
| 30 // Downloads the avatar image from a url. |
| 31 scoped_ptr<chrome::BitmapFetcher> fetcher_; |
| 32 |
| 33 // Needed by the BitmapFetcher to instantiate a URL fetcher. |
| 34 net::URLRequestContextGetter* request_context_; |
| 35 |
| 36 // Index of the avatar being downloaded. |
| 37 size_t icon_index_; |
| 38 |
| 39 ProfileInfoCache* cache_; // Weak. |
| 40 }; |
| 41 |
| 42 #endif // CHROME_BROWSER_PROFILES_PROFILE_AVATAR_DOWNLOADER_H_ |
OLD | NEW |