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

Side by Side Diff: content/renderer/browser_plugin/browser_plugin_manager_impl.cc

Issue 11093080: <webview>: First stab at implementing media permission request for guests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Handle multiple listeners based on our discussion, requires 2 webkit changes. Created 8 years 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/renderer/browser_plugin/browser_plugin_manager_impl.h" 5 #include "content/renderer/browser_plugin/browser_plugin_manager_impl.h"
6 6
7 #include "content/common/browser_plugin_messages.h" 7 #include "content/common/browser_plugin_messages.h"
8 #include "content/renderer/browser_plugin/browser_plugin.h" 8 #include "content/renderer/browser_plugin/browser_plugin.h"
9 #include "content/renderer/render_thread_impl.h" 9 #include "content/renderer/render_thread_impl.h"
10 #include "ui/gfx/point.h" 10 #include "ui/gfx/point.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 IPC_MESSAGE_HANDLER(BrowserPluginMsg_ShouldAcceptTouchEvents, 46 IPC_MESSAGE_HANDLER(BrowserPluginMsg_ShouldAcceptTouchEvents,
47 OnShouldAcceptTouchEvents) 47 OnShouldAcceptTouchEvents)
48 IPC_MESSAGE_HANDLER(BrowserPluginMsg_LoadStart, OnLoadStart) 48 IPC_MESSAGE_HANDLER(BrowserPluginMsg_LoadStart, OnLoadStart)
49 IPC_MESSAGE_HANDLER(BrowserPluginMsg_LoadAbort, OnLoadAbort) 49 IPC_MESSAGE_HANDLER(BrowserPluginMsg_LoadAbort, OnLoadAbort)
50 IPC_MESSAGE_HANDLER(BrowserPluginMsg_LoadRedirect, OnLoadRedirect) 50 IPC_MESSAGE_HANDLER(BrowserPluginMsg_LoadRedirect, OnLoadRedirect)
51 IPC_MESSAGE_HANDLER(BrowserPluginMsg_LoadCommit, OnLoadCommit) 51 IPC_MESSAGE_HANDLER(BrowserPluginMsg_LoadCommit, OnLoadCommit)
52 IPC_MESSAGE_HANDLER(BrowserPluginMsg_LoadStop, OnLoadStop) 52 IPC_MESSAGE_HANDLER(BrowserPluginMsg_LoadStop, OnLoadStop)
53 IPC_MESSAGE_HANDLER(BrowserPluginMsg_SetCursor, OnSetCursor) 53 IPC_MESSAGE_HANDLER(BrowserPluginMsg_SetCursor, OnSetCursor)
54 IPC_MESSAGE_HANDLER(BrowserPluginMsg_PluginAtPositionRequest, 54 IPC_MESSAGE_HANDLER(BrowserPluginMsg_PluginAtPositionRequest,
55 OnPluginAtPositionRequest); 55 OnPluginAtPositionRequest);
56 IPC_MESSAGE_HANDLER(BrowserPluginMsg_GuestUnresponsive, OnGuestUnresponsive) 56 IPC_MESSAGE_HANDLER(BrowserPluginMsg_RequestMediaAccess,
57 IPC_MESSAGE_HANDLER(BrowserPluginMsg_GuestResponsive, OnGuestResponsive) 57 OnRequestMediaAccess)
58 IPC_MESSAGE_UNHANDLED(handled = false) 58 IPC_MESSAGE_UNHANDLED(handled = false)
59 IPC_END_MESSAGE_MAP() 59 IPC_END_MESSAGE_MAP()
60 return handled; 60 return handled;
61 } 61 }
62 62
63 void BrowserPluginManagerImpl::OnPluginAtPositionRequest( 63 void BrowserPluginManagerImpl::OnPluginAtPositionRequest(
64 const IPC::Message& message, 64 const IPC::Message& message,
65 int request_id, 65 int request_id,
66 const gfx::Point& position) { 66 const gfx::Point& position) {
67 int instance_id = -1; 67 int instance_id = -1;
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 if (plugin) 178 if (plugin)
179 plugin->GuestUnresponsive(process_id); 179 plugin->GuestUnresponsive(process_id);
180 } 180 }
181 181
182 void BrowserPluginManagerImpl::OnGuestResponsive(int instance_id, 182 void BrowserPluginManagerImpl::OnGuestResponsive(int instance_id,
183 int process_id) { 183 int process_id) {
184 BrowserPlugin* plugin = GetBrowserPlugin(instance_id); 184 BrowserPlugin* plugin = GetBrowserPlugin(instance_id);
185 if (plugin) 185 if (plugin)
186 plugin->GuestResponsive(process_id); 186 plugin->GuestResponsive(process_id);
187 } 187 }
188
189 void BrowserPluginManagerImpl::OnRequestMediaAccess(
190 int instance_id,
191 int request_id,
192 const GURL& security_origin) {
193 BrowserPlugin* plugin = GetBrowserPlugin(instance_id);
194 if (plugin)
195 plugin->RequestMediaAccess(request_id, security_origin);
196 }
197
188 } // namespace content 198 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698