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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/passwords/account_avatar_fetcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/passwords/account_avatar_fetcher.h
diff --git a/chrome/browser/ui/passwords/account_avatar_fetcher.h b/chrome/browser/ui/passwords/account_avatar_fetcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..c3d5ae908d74bac6d3dd8f70fe2f505e562f77c7
--- /dev/null
+++ b/chrome/browser/ui/passwords/account_avatar_fetcher.h
@@ -0,0 +1,47 @@
+// Copyright 2015 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_UI_PASSWORDS_ACCOUNT_AVATAR_FETCHER_H_
+#define CHROME_BROWSER_UI_PASSWORDS_ACCOUNT_AVATAR_FETCHER_H_
+
+#include "base/memory/weak_ptr.h"
+#include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h"
+#include "url/gurl.h"
+
+namespace gfx {
+class ImageSkia;
+} // namespace gfx
+
+namespace net {
+class URLRequestContextGetter;
+} // namespace net
+
+class AccountAvatarFetcherDelegate {
+ public:
+ virtual void UpdateAvatar(const gfx::ImageSkia& image) = 0;
+};
+
+// Helper class to download an avatar. It deletes itself once the request is
+// done.
+class AccountAvatarFetcher : public chrome::BitmapFetcherDelegate {
+ public:
+ AccountAvatarFetcher(
+ const GURL& url,
+ const base::WeakPtr<AccountAvatarFetcherDelegate>& delegate);
+
+ void Start(net::URLRequestContextGetter* request_context);
+
+ private:
+ ~AccountAvatarFetcher() override;
+
+ // chrome::BitmapFetcherDelegate:
+ void OnFetchComplete(const GURL url, const SkBitmap* bitmap) override;
+
+ chrome::BitmapFetcher fetcher_;
+ base::WeakPtr<AccountAvatarFetcherDelegate> delegate_;
+
+ DISALLOW_COPY_AND_ASSIGN(AccountAvatarFetcher);
+};
+
+#endif // CHROME_BROWSER_UI_PASSWORDS_ACCOUNT_AVATAR_FETCHER_H_
« 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