summaryrefslogtreecommitdiffstats
path: root/chrome/browser/intents
diff options
context:
space:
mode:
authorgbillock@chromium.org <gbillock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-01 08:38:36 +0000
committergbillock@chromium.org <gbillock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-01 08:38:36 +0000
commit3a3b75ab9cc13b9acb466de0ef1bc7036756fce4 (patch)
treeb58f4946657cc25dfc6f667e10aad16f070be5b4 /chrome/browser/intents
parent75001aab2af6da7c04d30daf3019f0dba4982432 (diff)
downloadchromium_src-3a3b75ab9cc13b9acb466de0ef1bc7036756fce4.zip
chromium_src-3a3b75ab9cc13b9acb466de0ef1bc7036756fce4.tar.gz
chromium_src-3a3b75ab9cc13b9acb466de0ef1bc7036756fce4.tar.bz2
Pass user gesture indicator for RPH and intents.
We are moving to a policy which will change where we show RPH and web intents registrations between infobar and page-action type indicator depending on factors like user gesture, previous showing of the infobar, and perhaps other considerations. This change gets that user gesture indicator to the policy logic. It also incorporates a change to the web intents registration IPC to pass the service info struct instead of individual members. (Adding the user gesture went over the param limit, and passing the struct is a good change regardless.) R=groby@chromium.org,jam@chromium.org BUG=119438 TEST=*WebIntent*.* Review URL: https://chromiumcodereview.appspot.com/10447067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139996 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/intents')
-rw-r--r--chrome/browser/intents/register_intent_handler_helper.cc30
1 files changed, 7 insertions, 23 deletions
diff --git a/chrome/browser/intents/register_intent_handler_helper.cc b/chrome/browser/intents/register_intent_handler_helper.cc
index abfd47f..88c1f96 100644
--- a/chrome/browser/intents/register_intent_handler_helper.cc
+++ b/chrome/browser/intents/register_intent_handler_helper.cc
@@ -17,14 +17,12 @@
using content::WebContents;
// static
-void Browser::RegisterIntentHandlerHelper(WebContents* tab,
- const string16& action,
- const string16& type,
- const string16& href,
- const string16& title,
- const string16& disposition) {
- TabContentsWrapper* tcw = TabContentsWrapper::GetCurrentWrapperForContents(
- tab);
+void Browser::RegisterIntentHandlerHelper(
+ WebContents* tab,
+ const webkit_glue::WebIntentServiceData& data,
+ bool user_gesture) {
+ TabContentsWrapper* tcw =
+ TabContentsWrapper::GetCurrentWrapperForContents(tab);
if (!tcw || tcw->profile()->IsOffTheRecord())
return;
@@ -34,24 +32,10 @@ void Browser::RegisterIntentHandlerHelper(WebContents* tab,
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();
- service_url = url.Resolve(href);
- }
-
- webkit_glue::WebIntentServiceData service;
- service.service_url = service_url;
- service.action = action;
- service.type = type;
- service.title = title;
- service.setDisposition(disposition);
-
RegisterIntentHandlerInfoBarDelegate::MaybeShowIntentInfoBar(
tcw->infobar_tab_helper(),
WebIntentsRegistryFactory::GetForProfile(tcw->profile()),
- service,
+ data,
favicon_service,
tab->GetURL());
}