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

Unified Diff: chrome/browser/ui/web_applications/web_app_ui.cc

Issue 11411180: move favicon download code from chrome/ into content/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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/web_applications/web_app_ui.cc
diff --git a/chrome/browser/ui/web_applications/web_app_ui.cc b/chrome/browser/ui/web_applications/web_app_ui.cc
index 4346059658a4afc98e81cfb7e7e522a50629a2f8..b95ce3c7b1c043f6407f73e86bba0ddc4b20f341 100644
--- a/chrome/browser/ui/web_applications/web_app_ui.cc
+++ b/chrome/browser/ui/web_applications/web_app_ui.cc
@@ -11,14 +11,13 @@
#include "base/string16.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/extensions/tab_helper.h"
-#include "chrome/browser/favicon/favicon_download_helper.h"
-#include "chrome/browser/favicon/favicon_download_helper_delegate.h"
#include "chrome/browser/favicon/favicon_tab_helper.h"
#include "chrome/browser/favicon/favicon_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/web_applications/web_app.h"
#include "chrome/common/chrome_notification_types.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/favicon_download_delegate.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_source.h"
@@ -46,7 +45,7 @@ namespace {
// update them when icons are downloaded. It observes TAB_CLOSING notification
// and cancels all the work when the underlying tab is closing.
class UpdateShortcutWorker : public content::NotificationObserver,
- public FaviconDownloadHelperDelegate {
+ public content::FaviconDownloadDelegate {
public:
explicit UpdateShortcutWorker(WebContents* web_contents);
@@ -61,8 +60,8 @@ class UpdateShortcutWorker : public content::NotificationObserver,
// Downloads icon via the FaviconTabHelper.
void DownloadIcon();
- // FaviconDownloadHelperDelegate override.
- virtual void OnDidDownloadFavicon(
+ // content::WebContentsDelegate override.
jam 2012/11/27 01:16:31 nit: content::FaviconDownloadDelegate
Cait (Slow) 2012/11/28 00:11:45 Done.
+ virtual void DidDownloadFavicon(
int id,
const GURL& image_url,
bool errored,
@@ -121,6 +120,7 @@ UpdateShortcutWorker::UpdateShortcutWorker(WebContents* web_contents)
this,
chrome::NOTIFICATION_TAB_CLOSING,
content::Source<NavigationController>(&web_contents->GetController()));
+ web_contents_->RegisterFaviconDelegate(this);
}
void UpdateShortcutWorker::Run() {
@@ -156,16 +156,13 @@ void UpdateShortcutWorker::DownloadIcon() {
return;
}
- scoped_ptr<FaviconDownloadHelper> download_helper(
- new FaviconDownloadHelper(web_contents_, this));
-
- download_helper->DownloadFavicon(unprocessed_icons_.back().url,
- std::max(unprocessed_icons_.back().width,
- unprocessed_icons_.back().height));
+ web_contents_->DownloadFavicon(unprocessed_icons_.back().url,
+ std::max(unprocessed_icons_.back().width,
+ unprocessed_icons_.back().height));
unprocessed_icons_.pop_back();
}
-void UpdateShortcutWorker::OnDidDownloadFavicon(
+void UpdateShortcutWorker::DidDownloadFavicon(
int id,
const GURL& image_url,
bool errored,

Powered by Google App Engine
This is Rietveld 408576698