Index: chrome/browser/ui/intents/web_intent_icon_loader.h |
diff --git a/chrome/browser/ui/intents/web_intent_icon_loader.h b/chrome/browser/ui/intents/web_intent_icon_loader.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..bafebd1054b161f94010f2d25bb999838b817b62 |
--- /dev/null |
+++ b/chrome/browser/ui/intents/web_intent_icon_loader.h |
@@ -0,0 +1,49 @@ |
+// Copyright (c) 2012 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_INTENTS_WEB_INTENT_ICON_LOADER_H_ |
+#define CHROME_BROWSER_UI_INTENTS_WEB_INTENT_ICON_LOADER_H_ |
+ |
+#include "base/memory/weak_ptr.h" |
+#include "chrome/browser/common/cancelable_request.h" |
+#include "chrome/browser/favicon/favicon_service.h" |
+ |
+class Profile; |
+class WebIntentPickerModel; |
+ |
+namespace web_intents { |
+ |
+class IconLoader { |
James Hawkins
2012/10/17 03:38:39
Document class.
|
+ public: |
+ IconLoader(Profile* profile, WebIntentPickerModel* model); |
James Hawkins
2012/10/17 03:38:39
Document params.
|
+ ~IconLoader(); |
+ |
+ // Load the favicon associated with |url|. |
James Hawkins
2012/10/17 03:38:39
Loads
|
+ void LoadFavicon(const GURL& url); |
+ |
+ private: |
+ // Called when a favicon is returned from the FaviconService. |
+ void OnFaviconDataAvailable( |
James Hawkins
2012/10/17 03:38:39
Document what it does.
|
+ const GURL& url, |
+ FaviconService::Handle handle, |
+ const history::FaviconImageResult& image_result); |
+ |
+ // A weak pointer to the profile for the web contents. |
+ Profile* profile_; |
+ |
+ // A weak pointer to the model being updated. |
+ WebIntentPickerModel* model_; |
+ |
+ // Request consumer used when asynchronously loading favicons. |
+ CancelableRequestConsumer favicon_consumer_; |
+ |
+ // Factory for weak pointers used in callbacks for async calls to load icon. |
+ base::WeakPtrFactory<IconLoader> weak_ptr_factory_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(IconLoader); |
+}; |
+ |
+} // namespace web_intents; |
+ |
+#endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_ICON_LOADER_H_ |