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

Unified Diff: chrome/browser/ui/intents/web_intent_icon_loader.h

Issue 11137024: Factoring out of FaviconLoader (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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/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_

Powered by Google App Engine
This is Rietveld 408576698