Index: content/browser/web_contents/web_contents_impl.cc |
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc |
index 61d98d8faab7f8eaa2baecf2311112c8b073bb36..62af14c61eaa0d03b9f1ec7da797dc409fb5b478 100644 |
--- a/content/browser/web_contents/web_contents_impl.cc |
+++ b/content/browser/web_contents/web_contents_impl.cc |
@@ -682,6 +682,8 @@ bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host, |
OnSetSelectedColorInColorChooser) |
IPC_MESSAGE_HANDLER(ViewHostMsg_PepperPluginHung, OnPepperPluginHung) |
IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnWebUISend) |
+ IPC_MESSAGE_HANDLER(ViewHostMsg_RequestPpapiBrokerPermission, |
+ OnRequestPpapiBrokerPermission) |
IPC_MESSAGE_UNHANDLED(handled = false) |
IPC_END_MESSAGE_MAP_EX() |
message_source_ = NULL; |
@@ -2249,6 +2251,33 @@ void WebContentsImpl::OnWebUISend(const GURL& source_url, |
delegate_->WebUISend(this, source_url, name, args); |
} |
+void WebContentsImpl::OnRequestPpapiBrokerPermission( |
+ int request_id, |
+ const GURL& url, |
+ const FilePath& plugin_path) { |
+ base::Callback<void(bool)> callback = |
+ base::Bind(&WebContentsImpl::OnPpapiBrokerPermissionResult, |
+ base::Unretained(this), request_id); |
+ ObserverListBase<WebContentsObserver>::Iterator it(observers_); |
+ WebContentsObserver* observer; |
+ while ((observer = it.GetNext()) != NULL) { |
+ if (observer->RequestPpapiBrokerPermission(this, url, plugin_path, |
+ callback)) |
+ return; |
+ } |
+ |
+ // Fall back to allowing the request if no observer handled it. |
+ OnPpapiBrokerPermissionResult(request_id, true); |
+} |
+ |
+void WebContentsImpl::OnPpapiBrokerPermissionResult(int request_id, |
+ bool result) { |
+ RenderViewHostImpl* rvh = GetRenderViewHostImpl(); |
+ rvh->Send(new ViewMsg_PpapiBrokerPermissionResult(rvh->GetRoutingID(), |
+ request_id, |
+ result)); |
+} |
+ |
// Notifies the RenderWidgetHost instance about the fact that the page is |
// loading, or done loading and calls the base implementation. |
void WebContentsImpl::SetIsLoading(bool is_loading, |