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

Unified Diff: chrome/browser/ui/browser.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/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 0b299f3ba6c03a1b506a5de18f1855c35c03d9dd..4f617371fdda1a32e38c53fa727d3d90e26b511a 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -2564,14 +2564,18 @@ void Browser::RegisterIntentHandlerHelper(TabContents* tab,
const string16& href,
const string16& title,
const string16& disposition) {
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents))
+ return;
+
TabContentsWrapper* tcw = TabContentsWrapper::GetCurrentWrapperForContents(
tab);
if (!tcw || tcw->profile()->IsOffTheRecord())
return;
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents))
- return;
+ FaviconService* favicon_service =
+ tcw->profile()->GetFaviconService(Profile::EXPLICIT_ACCESS);
+ // |href| can be relative to originating URL. Resolve if necessary.
GURL service_url(href);
if (!service_url.is_valid()) {
const GURL& url = tab->GetURL();
@@ -2589,7 +2593,9 @@ void Browser::RegisterIntentHandlerHelper(TabContents* tab,
infobar_helper->AddInfoBar(new RegisterIntentHandlerInfoBarDelegate(
infobar_helper,
WebIntentsRegistryFactory::GetForProfile(tcw->profile()),
- service));
+ service,
+ favicon_service,
+ tab->GetURL()));
}
// static

Powered by Google App Engine
This is Rietveld 408576698