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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 10854040: Add hooks to content to request permission to connect to the PPAPI broker. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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: 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 d5a09dcbb874a55aa40e394cedb5f2975d3edf94..469270a5cadddcefcf3b392f86938ae08565207b 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -673,6 +673,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;
@@ -2221,6 +2223,29 @@ 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) {
+ if (!delegate_) {
+ OnPpapiBrokerPermissionResult(request_id, false);
+ return;
+ }
+
+ delegate_->RequestPpapiBrokerPermission(
+ this, url, plugin_path,
+ base::Bind(&WebContentsImpl::OnPpapiBrokerPermissionResult,
brettw 2012/08/20 05:29:47 I don't really understand how the memory managemen
Bernhard Bauer 2012/08/20 14:43:20 The infobar is owned by the InfobarTabHelper, whic
+ base::Unretained(this), request_id));
+}
+
+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,

Powered by Google App Engine
This is Rietveld 408576698