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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 OnRegisterProtocolHandler) 666 OnRegisterProtocolHandler)
667 IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply) 667 IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply)
668 IPC_MESSAGE_HANDLER(ViewHostMsg_CrashedPlugin, OnCrashedPlugin) 668 IPC_MESSAGE_HANDLER(ViewHostMsg_CrashedPlugin, OnCrashedPlugin)
669 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) 669 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed)
670 IPC_MESSAGE_HANDLER(ViewHostMsg_OpenColorChooser, OnOpenColorChooser) 670 IPC_MESSAGE_HANDLER(ViewHostMsg_OpenColorChooser, OnOpenColorChooser)
671 IPC_MESSAGE_HANDLER(ViewHostMsg_EndColorChooser, OnEndColorChooser) 671 IPC_MESSAGE_HANDLER(ViewHostMsg_EndColorChooser, OnEndColorChooser)
672 IPC_MESSAGE_HANDLER(ViewHostMsg_SetSelectedColorInColorChooser, 672 IPC_MESSAGE_HANDLER(ViewHostMsg_SetSelectedColorInColorChooser,
673 OnSetSelectedColorInColorChooser) 673 OnSetSelectedColorInColorChooser)
674 IPC_MESSAGE_HANDLER(ViewHostMsg_PepperPluginHung, OnPepperPluginHung) 674 IPC_MESSAGE_HANDLER(ViewHostMsg_PepperPluginHung, OnPepperPluginHung)
675 IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnWebUISend) 675 IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnWebUISend)
676 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestPpapiBrokerPermission,
677 OnRequestPpapiBrokerPermission)
676 IPC_MESSAGE_UNHANDLED(handled = false) 678 IPC_MESSAGE_UNHANDLED(handled = false)
677 IPC_END_MESSAGE_MAP_EX() 679 IPC_END_MESSAGE_MAP_EX()
678 message_source_ = NULL; 680 message_source_ = NULL;
679 681
680 if (!message_is_ok) { 682 if (!message_is_ok) {
681 content::RecordAction(UserMetricsAction("BadMessageTerminate_RVD")); 683 content::RecordAction(UserMetricsAction("BadMessageTerminate_RVD"));
682 GetRenderProcessHost()->ReceivedBadMessage(); 684 GetRenderProcessHost()->ReceivedBadMessage();
683 } 685 }
684 686
685 return handled; 687 return handled;
(...skipping 1528 matching lines...) Expand 10 before | Expand all | Expand 10 after
2214 2216
2215 // This exists for render views that don't have a WebUI, but do have WebUI 2217 // This exists for render views that don't have a WebUI, but do have WebUI
2216 // bindings enabled. 2218 // bindings enabled.
2217 void WebContentsImpl::OnWebUISend(const GURL& source_url, 2219 void WebContentsImpl::OnWebUISend(const GURL& source_url,
2218 const std::string& name, 2220 const std::string& name,
2219 const base::ListValue& args) { 2221 const base::ListValue& args) {
2220 if (delegate_) 2222 if (delegate_)
2221 delegate_->WebUISend(this, source_url, name, args); 2223 delegate_->WebUISend(this, source_url, name, args);
2222 } 2224 }
2223 2225
2226 void WebContentsImpl::OnRequestPpapiBrokerPermission(
2227 int request_id,
2228 const GURL& url,
2229 const FilePath& plugin_path) {
2230 if (!delegate_) {
2231 OnPpapiBrokerPermissionResult(request_id, false);
2232 return;
2233 }
2234
2235 delegate_->RequestPpapiBrokerPermission(
2236 this, url, plugin_path,
2237 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
2238 base::Unretained(this), request_id));
2239 }
2240
2241 void WebContentsImpl::OnPpapiBrokerPermissionResult(int request_id,
2242 bool result) {
2243 RenderViewHostImpl* rvh = GetRenderViewHostImpl();
2244 rvh->Send(new ViewMsg_PpapiBrokerPermissionResult(rvh->GetRoutingID(),
2245 request_id,
2246 result));
2247 }
2248
2224 // Notifies the RenderWidgetHost instance about the fact that the page is 2249 // Notifies the RenderWidgetHost instance about the fact that the page is
2225 // loading, or done loading and calls the base implementation. 2250 // loading, or done loading and calls the base implementation.
2226 void WebContentsImpl::SetIsLoading(bool is_loading, 2251 void WebContentsImpl::SetIsLoading(bool is_loading,
2227 LoadNotificationDetails* details) { 2252 LoadNotificationDetails* details) {
2228 if (is_loading == is_loading_) 2253 if (is_loading == is_loading_)
2229 return; 2254 return;
2230 2255
2231 if (!is_loading) { 2256 if (!is_loading) {
2232 load_state_ = net::LoadStateWithParam(net::LOAD_STATE_IDLE, string16()); 2257 load_state_ = net::LoadStateWithParam(net::LOAD_STATE_IDLE, string16());
2233 load_state_host_.clear(); 2258 load_state_host_.clear();
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
3184 old_browser_plugin_host()->embedder_render_process_host(); 3209 old_browser_plugin_host()->embedder_render_process_host();
3185 *embedder_container_id = old_browser_plugin_host()->instance_id(); 3210 *embedder_container_id = old_browser_plugin_host()->instance_id();
3186 int embedder_process_id = 3211 int embedder_process_id =
3187 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; 3212 embedder_render_process_host ? embedder_render_process_host->GetID() : -1;
3188 if (embedder_process_id != -1) { 3213 if (embedder_process_id != -1) {
3189 *embedder_channel_name = 3214 *embedder_channel_name =
3190 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), 3215 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(),
3191 embedder_process_id); 3216 embedder_process_id);
3192 } 3217 }
3193 } 3218 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698