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

Unified Diff: chrome/browser/ui/tab_contents/tab_contents_wrapper.cc

Issue 7601013: Web Intents: Hook up the register intent InfoBar with the WebIntentsRegistry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Test fix. Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/tab_contents/tab_contents_wrapper.cc
diff --git a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc
index 438c02159ea10aeb831ee54b3e54deffdcf85c59..55c7b7881e1cef5f501b5e41877d2a39ba8f03ff 100644
--- a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc
+++ b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
+#include "base/utf_string_conversions.h"
+
#include "base/command_line.h"
#include "base/lazy_instance.h"
#include "chrome/browser/autocomplete_history_manager.h"
@@ -22,6 +24,7 @@
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/history/history_tab_helper.h"
#include "chrome/browser/intents/register_intent_handler_infobar_delegate.h"
+#include "chrome/browser/intents/web_intent_data.h"
#include "chrome/browser/omnibox_search_hint.h"
#include "chrome/browser/password_manager/password_manager.h"
#include "chrome/browser/password_manager_delegate_impl.h"
@@ -597,7 +600,18 @@ void TabContentsWrapper::OnRegisterIntentHandler(const string16& action,
if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents))
return;
- AddInfoBar(new RegisterIntentHandlerInfoBarDelegate(tab_contents()));
+ GURL service_url(href);
+ if (!service_url.is_valid()) {
+ const GURL& url = tab_contents()->GetURL();
+ service_url = url.Resolve(href);
+ }
+
+ WebIntentData intent;
+ intent.service_url = service_url;
+ intent.action = action;
+ intent.type = type;
+ intent.title = title;
+ AddInfoBar(new RegisterIntentHandlerInfoBarDelegate(tab_contents(), intent));
}
void TabContentsWrapper::OnSnapshot(const SkBitmap& bitmap) {

Powered by Google App Engine
This is Rietveld 408576698