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

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

Issue 7461093: Web Intents: Preparatory work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: pkasting fix 3. Created 9 years, 5 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
« no previous file with comments | « chrome/browser/ui/tab_contents/tab_contents_wrapper.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3f05b60fb1226bbfa325f811d92acc2a7b54ce4c..1d6c9b2f694d8a53f7213e5765ae8c94ea4b3d8c 100644
--- a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc
+++ b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc
@@ -21,6 +21,7 @@
#include "chrome/browser/file_select_helper.h"
#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/omnibox_search_hint.h"
#include "chrome/browser/password_manager/password_manager.h"
#include "chrome/browser/password_manager_delegate_impl.h"
@@ -397,6 +398,8 @@ bool TabContentsWrapper::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(ViewHostMsg_JSOutOfMemory, OnJSOutOfMemory)
IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterProtocolHandler,
OnRegisterProtocolHandler)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterIntentHandler,
+ OnRegisterIntentHandler)
IPC_MESSAGE_HANDLER(ViewHostMsg_Snapshot, OnSnapshot)
IPC_MESSAGE_HANDLER(ViewHostMsg_PDFHasUnsupportedFeature,
OnPDFHasUnsupportedFeature)
@@ -570,6 +573,19 @@ void TabContentsWrapper::OnRegisterProtocolHandler(const std::string& protocol,
}
}
+void TabContentsWrapper::OnRegisterIntentHandler(const string16& action,
+ const string16& type,
+ const string16& href,
+ const string16& title) {
+ if (profile()->IsOffTheRecord())
+ return;
+
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents))
+ return;
+
+ AddInfoBar(new RegisterIntentHandlerInfoBarDelegate(tab_contents()));
+}
+
void TabContentsWrapper::OnSnapshot(const SkBitmap& bitmap) {
NotificationService::current()->Notify(
chrome::NOTIFICATION_TAB_SNAPSHOT_TAKEN,
« no previous file with comments | « chrome/browser/ui/tab_contents/tab_contents_wrapper.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698