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

Unified Diff: chrome/browser/intents/register_intent_handler_infobar_delegate.cc

Issue 8469018: Provide assumed favicon for intents if service provider page was never visited. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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/intents/register_intent_handler_infobar_delegate.cc
diff --git a/chrome/browser/intents/register_intent_handler_infobar_delegate.cc b/chrome/browser/intents/register_intent_handler_infobar_delegate.cc
index c0914323c1c1e8b9caedce3669f0a6d7c4a44ec9..e32e42dab7f20114bdec771b2d68170540532588 100644
--- a/chrome/browser/intents/register_intent_handler_infobar_delegate.cc
+++ b/chrome/browser/intents/register_intent_handler_infobar_delegate.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "base/utf_string_conversions.h"
+#include "chrome/browser/favicon/favicon_service.h"
#include "chrome/browser/intents/web_intents_registry.h"
#include "chrome/browser/intents/web_intents_registry_factory.h"
#include "chrome/browser/profiles/profile.h"
@@ -15,10 +16,14 @@
RegisterIntentHandlerInfoBarDelegate::RegisterIntentHandlerInfoBarDelegate(
InfoBarTabHelper* infobar_helper,
WebIntentsRegistry* registry,
- const webkit_glue::WebIntentServiceData& service)
+ const webkit_glue::WebIntentServiceData& service,
+ FaviconService* favicon_service,
+ const GURL& origin_url)
: ConfirmInfoBarDelegate(infobar_helper),
registry_(registry),
- service_(service) {
+ service_(service),
+ favicon_service_(favicon_service),
+ origin_url_(origin_url) {
}
InfoBarDelegate::Type
@@ -46,6 +51,11 @@ string16 RegisterIntentHandlerInfoBarDelegate::GetButtonLabel(
bool RegisterIntentHandlerInfoBarDelegate::Accept() {
registry_->RegisterIntentProvider(service_);
+
+ // Register a temporary FavIcon in case we never visited the provider page.
+ if (favicon_service_ && origin_url_ != service_.service_url)
+ favicon_service_->CloneFavicon(origin_url_, service_.service_url);
+
return true;
}

Powered by Google App Engine
This is Rietveld 408576698