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

Side by Side Diff: chrome/browser/intents/register_intent_handler_helper.cc

Issue 9521013: Remove web intents from Chrome on Android build (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resolved nits Created 8 years, 9 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // static
6 void Browser::RegisterIntentHandlerHelper(WebContents* tab,
7 const string16& action,
8 const string16& type,
9 const string16& href,
10 const string16& title,
11 const string16& disposition) {
12 if (!web_intents::IsWebIntentsEnabled())
13 return;
14
15 TabContentsWrapper* tcw = TabContentsWrapper::GetCurrentWrapperForContents(
16 tab);
17 if (!tcw || tcw->profile()->IsOffTheRecord())
18 return;
19
20 FaviconService* favicon_service =
21 tcw->profile()->GetFaviconService(Profile::EXPLICIT_ACCESS);
22
23 // |href| can be relative to originating URL. Resolve if necessary.
24 GURL service_url(href);
25 if (!service_url.is_valid()) {
26 const GURL& url = tab->GetURL();
27 service_url = url.Resolve(href);
28 }
29
30 webkit_glue::WebIntentServiceData service;
31 service.service_url = service_url;
32 service.action = action;
33 service.type = type;
34 service.title = title;
35 service.setDisposition(disposition);
36
37 RegisterIntentHandlerInfoBarDelegate::MaybeShowIntentInfoBar(
38 tcw->infobar_tab_helper(),
39 WebIntentsRegistryFactory::GetForProfile(tcw->profile()),
40 service,
41 favicon_service,
42 tab->GetURL());
43 }
44
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698