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

Side by Side Diff: content/browser/browser_plugin/browser_plugin_embedder.h

Issue 11093080: <webview>: First stab at implementing media permission request for guests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and reup patch for review. Created 8 years, 1 month 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 // A BrowserPluginEmbedder has a list of guests it manages. 5 // A BrowserPluginEmbedder has a list of guests it manages.
6 // In the beginning when a renderer sees one or more guests (BrowserPlugin 6 // In the beginning when a renderer sees one or more guests (BrowserPlugin
7 // instance(s)) and there is a request to navigate to them, the WebContents for 7 // instance(s)) and there is a request to navigate to them, the WebContents for
8 // that renderer creates a BrowserPluginEmbedder for itself. The 8 // that renderer creates a BrowserPluginEmbedder for itself. The
9 // BrowserPluginEmbedder, in turn, manages a set of BrowserPluginGuests -- one 9 // BrowserPluginEmbedder, in turn, manages a set of BrowserPluginGuests -- one
10 // BrowserPluginGuest for each guest in the embedding WebContents. Note that 10 // BrowserPluginGuest for each guest in the embedding WebContents. Note that
11 // each of these BrowserPluginGuest objects has its own WebContents. 11 // each of these BrowserPluginGuest objects has its own WebContents.
12 // BrowserPluginEmbedder routes any messages directed to a guest from the 12 // BrowserPluginEmbedder routes any messages directed to a guest from the
13 // renderer (BrowserPlugin) to the appropriate guest (identified by the guest's 13 // renderer (BrowserPlugin) to the appropriate guest (identified by the guest's
14 // |instance_id|). 14 // |instance_id|).
15 // 15 //
16 // BrowserPluginEmbedder is responsible for cleaning up the guests when the 16 // BrowserPluginEmbedder is responsible for cleaning up the guests when the
17 // embedder frame navigates away to a different page or deletes the guests from 17 // embedder frame navigates away to a different page or deletes the guests from
18 // the existing page. 18 // the existing page.
19 19
20 #ifndef CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ 20 #ifndef CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_
21 #define CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ 21 #define CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_
22 22
23 #include <map> 23 #include <map>
24 24
25 #include "base/compiler_specific.h" 25 #include "base/compiler_specific.h"
26 #include "content/public/browser/notification_observer.h" 26 #include "content/public/browser/notification_observer.h"
27 #include "content/public/browser/notification_registrar.h" 27 #include "content/public/browser/notification_registrar.h"
28 #include "content/public/browser/web_contents.h" 28 #include "content/public/browser/web_contents.h"
29 #include "content/public/browser/web_contents_observer.h" 29 #include "content/public/browser/web_contents_observer.h"
30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h"
30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragStatus.h" 31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragStatus.h"
31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h"
32 #include "ui/surface/transport_dib.h" 32 #include "ui/surface/transport_dib.h"
33 #include "webkit/glue/webdropdata.h" 33 #include "webkit/glue/webdropdata.h"
34 34
35 struct BrowserPluginHostMsg_AutoSize_Params; 35 struct BrowserPluginHostMsg_AutoSize_Params;
36 struct BrowserPluginHostMsg_CreateGuest_Params; 36 struct BrowserPluginHostMsg_CreateGuest_Params;
37 struct BrowserPluginHostMsg_ResizeGuest_Params; 37 struct BrowserPluginHostMsg_ResizeGuest_Params;
38 38
39 namespace WebKit { 39 namespace WebKit {
40 class WebInputEvent; 40 class WebInputEvent;
41 } 41 }
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 const WebDropData& drop_data, 118 const WebDropData& drop_data,
119 WebKit::WebDragOperationsMask drag_mask, 119 WebKit::WebDragOperationsMask drag_mask,
120 const gfx::Point& location); 120 const gfx::Point& location);
121 void SetAutoSize( 121 void SetAutoSize(
122 int instance_id, 122 int instance_id,
123 const BrowserPluginHostMsg_AutoSize_Params& auto_size_params, 123 const BrowserPluginHostMsg_AutoSize_Params& auto_size_params,
124 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params); 124 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params);
125 125
126 bool visible() const { return visible_; } 126 bool visible() const { return visible_; }
127 127
128 // Allows or denies a guest's media access request after the embedder has
129 // decided.
130 void AllowMediaAccess(int instance_id, int request_id, bool should_allow);
131
128 // Overrides factory for testing. Default (NULL) value indicates regular 132 // Overrides factory for testing. Default (NULL) value indicates regular
129 // (non-test) environment. 133 // (non-test) environment.
130 static void set_factory_for_testing(BrowserPluginHostFactory* factory) { 134 static void set_factory_for_testing(BrowserPluginHostFactory* factory) {
131 factory_ = factory; 135 factory_ = factory;
132 } 136 }
133 137
134 // Returns the RenderViewHost at a point (|x|, |y|) asynchronously via 138 // Returns the RenderViewHost at a point (|x|, |y|) asynchronously via
135 // |callback|. We need a roundtrip to renderer process to get this 139 // |callback|. We need a roundtrip to renderer process to get this
136 // information. 140 // information.
137 void GetRenderViewHostAtPosition( 141 void GetRenderViewHostAtPosition(
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 GetRenderViewHostCallbackMap pending_get_render_view_callbacks_; 183 GetRenderViewHostCallbackMap pending_get_render_view_callbacks_;
180 // Next request id for BrowserPluginMsg_PluginAtPositionRequest query. 184 // Next request id for BrowserPluginMsg_PluginAtPositionRequest query.
181 int next_get_render_view_request_id_; 185 int next_get_render_view_request_id_;
182 186
183 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); 187 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder);
184 }; 188 };
185 189
186 } // namespace content 190 } // namespace content
187 191
188 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ 192 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698