Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 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_INTENTS_WEB_INTENT_ICON_LOADER_H_ | |
| 6 #define CHROME_BROWSER_UI_INTENTS_WEB_INTENT_ICON_LOADER_H_ | |
| 7 | |
| 8 #include "base/memory/weak_ptr.h" | |
| 9 #include "chrome/browser/common/cancelable_request.h" | |
| 10 #include "chrome/browser/favicon/favicon_service.h" | |
| 11 | |
| 12 class Profile; | |
| 13 class WebIntentPickerModel; | |
| 14 | |
| 15 namespace web_intents { | |
| 16 | |
| 17 class IconLoader { | |
|
James Hawkins
2012/10/17 03:38:39
Document class.
| |
| 18 public: | |
| 19 IconLoader(Profile* profile, WebIntentPickerModel* model); | |
|
James Hawkins
2012/10/17 03:38:39
Document params.
| |
| 20 ~IconLoader(); | |
| 21 | |
| 22 // Load the favicon associated with |url|. | |
|
James Hawkins
2012/10/17 03:38:39
Loads
| |
| 23 void LoadFavicon(const GURL& url); | |
| 24 | |
| 25 private: | |
| 26 // Called when a favicon is returned from the FaviconService. | |
| 27 void OnFaviconDataAvailable( | |
|
James Hawkins
2012/10/17 03:38:39
Document what it does.
| |
| 28 const GURL& url, | |
| 29 FaviconService::Handle handle, | |
| 30 const history::FaviconImageResult& image_result); | |
| 31 | |
| 32 // A weak pointer to the profile for the web contents. | |
| 33 Profile* profile_; | |
| 34 | |
| 35 // A weak pointer to the model being updated. | |
| 36 WebIntentPickerModel* model_; | |
| 37 | |
| 38 // Request consumer used when asynchronously loading favicons. | |
| 39 CancelableRequestConsumer favicon_consumer_; | |
| 40 | |
| 41 // Factory for weak pointers used in callbacks for async calls to load icon. | |
| 42 base::WeakPtrFactory<IconLoader> weak_ptr_factory_; | |
| 43 | |
| 44 DISALLOW_COPY_AND_ASSIGN(IconLoader); | |
| 45 }; | |
| 46 | |
| 47 } // namespace web_intents; | |
| 48 | |
| 49 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_ICON_LOADER_H_ | |
| OLD | NEW |