Index: content/browser/tab_contents/tab_contents.cc |
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc |
index 30b91e962f978d70306a6240e48d41a59d47d2b5..c0de537aeaae9a839d67dfee4cffa6180c4299d6 100644 |
--- a/content/browser/tab_contents/tab_contents.cc |
+++ b/content/browser/tab_contents/tab_contents.cc |
@@ -22,6 +22,8 @@ |
#include "chrome/browser/child_process_security_policy.h" |
#include "chrome/browser/content_settings/content_settings_details.h" |
#include "chrome/browser/content_settings/host_content_settings_map.h" |
+#include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
+#include "chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.h" |
#include "chrome/browser/debugger/devtools_manager.h" |
#include "chrome/browser/defaults.h" |
#include "chrome/browser/desktop_notification_handler.h" |
@@ -446,6 +448,8 @@ bool TabContents::OnMessageReceived(const IPC::Message& message) { |
OnInstallApplication) |
IPC_MESSAGE_HANDLER(ViewHostMsg_PageContents, OnPageContents) |
IPC_MESSAGE_HANDLER(ViewHostMsg_PageTranslated, OnPageTranslated) |
+ IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterProtocolHandler, |
+ OnRegisterProtocolHandler) |
IPC_MESSAGE_HANDLER(ViewHostMsg_SetSuggestions, OnSetSuggestions) |
IPC_MESSAGE_HANDLER(ViewHostMsg_InstantSupportDetermined, |
OnInstantSupportDetermined) |
@@ -1963,6 +1967,19 @@ void TabContents::OnPageTranslated(int32 page_id, |
Details<PageTranslatedDetails>(&details)); |
} |
+void TabContents::OnRegisterProtocolHandler(const std::string& protocol, |
+ const GURL& url, |
+ const string16& title) { |
+ ProtocolHandlerRegistry* registry = profile()->GetProtocolHandlerRegistry(); |
+ ProtocolHandler* handler = ProtocolHandler::CreateProtocolHandler(protocol, |
+ url, |
+ title); |
+ if (handler != NULL) { |
+ RegisterProtocolHandlerInfoBarDelegate::AttemptRegisterProtocolHandler( |
+ this, registry, handler); |
+ } |
+} |
+ |
void TabContents::OnSetSuggestions( |
int32 page_id, |
const std::vector<std::string>& suggestions) { |