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

Side by Side Diff: chrome/browser/ui/passwords/account_avatar_fetcher.h

Issue 901493003: Extract some account chooser views things for cross-platform use. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/ui/passwords/account_avatar_fetcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 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
5 #ifndef CHROME_BROWSER_UI_PASSWORDS_ACCOUNT_AVATAR_FETCHER_H_
6 #define CHROME_BROWSER_UI_PASSWORDS_ACCOUNT_AVATAR_FETCHER_H_
7
8 #include "base/memory/weak_ptr.h"
9 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h"
10 #include "url/gurl.h"
11
12 namespace gfx {
13 class ImageSkia;
14 } // namespace gfx
15
16 namespace net {
17 class URLRequestContextGetter;
18 } // namespace net
19
20 class AccountAvatarFetcherDelegate {
21 public:
22 virtual void UpdateAvatar(const gfx::ImageSkia& image) = 0;
23 };
24
25 // Helper class to download an avatar. It deletes itself once the request is
26 // done.
27 class AccountAvatarFetcher : public chrome::BitmapFetcherDelegate {
28 public:
29 AccountAvatarFetcher(
30 const GURL& url,
31 const base::WeakPtr<AccountAvatarFetcherDelegate>& delegate);
32
33 void Start(net::URLRequestContextGetter* request_context);
34
35 private:
36 ~AccountAvatarFetcher() override;
37
38 // chrome::BitmapFetcherDelegate:
39 void OnFetchComplete(const GURL url, const SkBitmap* bitmap) override;
40
41 chrome::BitmapFetcher fetcher_;
42 base::WeakPtr<AccountAvatarFetcherDelegate> delegate_;
43
44 DISALLOW_COPY_AND_ASSIGN(AccountAvatarFetcher);
45 };
46
47 #endif // CHROME_BROWSER_UI_PASSWORDS_ACCOUNT_AVATAR_FETCHER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/passwords/account_avatar_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698