diff options
author | groby@chromium.org <groby@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-18 05:49:56 +0000 |
---|---|---|
committer | groby@chromium.org <groby@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-18 05:49:56 +0000 |
commit | 8229b5e68270ebcd70f445aef4ca573a8b713a29 (patch) | |
tree | 96ab3aa5bcc5136039cdc37a1e53d8991e293da4 /chrome/browser/ui/browser.cc | |
parent | 6c5746e78be4d36aea595e7940ce9a9b12ce4cdf (diff) | |
download | chromium_src-8229b5e68270ebcd70f445aef4ca573a8b713a29.zip chromium_src-8229b5e68270ebcd70f445aef4ca573a8b713a29.tar.gz chromium_src-8229b5e68270ebcd70f445aef4ca573a8b713a29.tar.bz2 |
Provide assumed favicon for intents if page was never visited.
If the service_url has never been visited, the IntentsPicker used to show
a default icon. This change will instead associate the favicon of the
registration page with the service_url page.
BUG=99784
TEST=Start with clean browser install. Run with --enable-web-intents, register a provider from webintents.org. Start picker, it should show WI favicon.
Review URL: http://codereview.chromium.org/8469018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110662 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/browser.cc')
-rw-r--r-- | chrome/browser/ui/browser.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index b25dd85..2855fc9 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -2576,14 +2576,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(); @@ -2600,7 +2604,9 @@ void Browser::RegisterIntentHandlerHelper(TabContents* tab, RegisterIntentHandlerInfoBarDelegate::MaybeShowIntentInfoBar( tcw->infobar_tab_helper(), WebIntentsRegistryFactory::GetForProfile(tcw->profile()), - service); + service, + favicon_service, + tab->GetURL()); } // static |