Index: chrome/browser/ui/ash/launcher/launcher_favicon_loader.cc |
diff --git a/chrome/browser/ui/ash/launcher/launcher_favicon_loader.cc b/chrome/browser/ui/ash/launcher/launcher_favicon_loader.cc |
index 468d7daba9dd727a85d8d8e3aa9741a14bd5dd9e..25ebcbd3d6f2bbde450ca5e3e651823cb4cf2880 100644 |
--- a/chrome/browser/ui/ash/launcher/launcher_favicon_loader.cc |
+++ b/chrome/browser/ui/ash/launcher/launcher_favicon_loader.cc |
@@ -5,17 +5,18 @@ |
#include "chrome/browser/ui/ash/launcher/launcher_favicon_loader.h" |
#include "base/logging.h" |
-#include "chrome/browser/favicon/favicon_download_helper.h" |
-#include "chrome/browser/favicon/favicon_download_helper_delegate.h" |
#include "chrome/browser/ui/ash/launcher/browser_launcher_item_controller.h" |
-#include "chrome/common/favicon_url.h" |
-#include "chrome/common/icon_messages.h" |
+#include "content/public/browser/favicon_download_delegate.h" |
#include "content/public/browser/render_view_host.h" |
#include "content/public/browser/web_contents.h" |
-#include "content/public/browser/web_contents_delegate.h" |
+#include "content/public/common/favicon_url.h" |
#include "googleurl/src/gurl.h" |
#include "third_party/skia/include/core/SkBitmap.h" |
+using content::FaviconURL; |
+ |
+using content::FaviconURL; |
+ |
namespace internal { |
const int kMaxBitmapSize = 256; |
@@ -26,12 +27,13 @@ const int kMaxBitmapSize = 256; |
// These icon bitmaps are not resized and are not cached beyond the lifetime |
// of the class. Bitmaps larger than kMaxBitmapSize are ignored. |
-class FaviconBitmapHandler : public FaviconDownloadHelperDelegate { |
+class FaviconBitmapHandler : public content::FaviconDownloadDelegate { |
public: |
FaviconBitmapHandler(content::WebContents* web_contents, |
LauncherFaviconLoader::Delegate* delegate) |
- : delegate_(delegate) { |
- download_helper_.reset(new FaviconDownloadHelper(web_contents, this)); |
+ : delegate_(delegate), |
+ web_contents_(web_contents) { |
+ web_contents->RegisterFaviconDelegate(this); |
} |
~FaviconBitmapHandler() {} |
@@ -40,12 +42,12 @@ class FaviconBitmapHandler : public FaviconDownloadHelperDelegate { |
bool HasPendingDownloads() const; |
- // FaviconDownloadHelperDelegate methods |
- virtual void OnUpdateFaviconURL( |
+ // FaviconDownloadDelegate methods |
+ virtual void UpdateFaviconURL( |
int32 page_id, |
const std::vector<FaviconURL>& candidates) OVERRIDE; |
- virtual void OnDidDownloadFavicon( |
+ virtual void DidDownloadFavicon( |
int id, |
const GURL& image_url, |
bool errored, |
@@ -58,7 +60,7 @@ class FaviconBitmapHandler : public FaviconDownloadHelperDelegate { |
LauncherFaviconLoader::Delegate* delegate_; |
- scoped_ptr<FaviconDownloadHelper> download_helper_; |
+ content::WebContents* web_contents_; |
typedef std::set<GURL> UrlSet; |
// Map of pending download urls. |
@@ -72,7 +74,7 @@ class FaviconBitmapHandler : public FaviconDownloadHelperDelegate { |
DISALLOW_COPY_AND_ASSIGN(FaviconBitmapHandler); |
}; |
-void FaviconBitmapHandler::OnUpdateFaviconURL( |
+void FaviconBitmapHandler::UpdateFaviconURL( |
int32 page_id, |
const std::vector<FaviconURL>& candidates) { |
// This function receives a complete list of faviocn urls for the page. |
@@ -110,11 +112,11 @@ void FaviconBitmapHandler::OnUpdateFaviconURL( |
if (pending_requests_.find(*iter) != pending_requests_.end()) |
continue; // Skip already pending downloads. |
pending_requests_.insert(*iter); |
- download_helper_->DownloadFavicon(*iter, 0); |
+ web_contents_->DownloadFavicon(*iter, 0); |
} |
} |
-void FaviconBitmapHandler::OnDidDownloadFavicon( |
+void FaviconBitmapHandler::DidDownloadFavicon( |
int id, |
const GURL& image_url, |
bool errored, |