OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 5 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
7 | 7 |
8 #include "third_party/WebKit/public/web/WebPlugin.h" | 8 #include "third_party/WebKit/public/web/WebPlugin.h" |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 void TrackObjectLifetime(const NPVariant* request, int id); | 125 void TrackObjectLifetime(const NPVariant* request, int id); |
126 | 126 |
127 // Returns true if |point| lies within the bounds of the plugin rectangle. | 127 // Returns true if |point| lies within the bounds of the plugin rectangle. |
128 // Not OK to use this function for making security-sensitive decision since it | 128 // Not OK to use this function for making security-sensitive decision since it |
129 // can return false positives when the plugin has rotation transformation | 129 // can return false positives when the plugin has rotation transformation |
130 // applied. | 130 // applied. |
131 bool InBounds(const gfx::Point& point) const; | 131 bool InBounds(const gfx::Point& point) const; |
132 | 132 |
133 gfx::Point ToLocalCoordinates(const gfx::Point& point) const; | 133 gfx::Point ToLocalCoordinates(const gfx::Point& point) const; |
134 // Called by browser plugin binding. | 134 // Called by browser plugin binding. |
135 void OnEmbedderDecidedPermission(int request_id, bool allow); | 135 void OnEmbedderDecidedPermission(int request_id, bool allow, |
| 136 const std::string& user_input); |
136 | 137 |
137 // Attaches this BrowserPlugin to a guest with the provided |instance_id|. | 138 // Attaches this BrowserPlugin to a guest with the provided |instance_id|. |
138 // If the |instance_id| is not yet associated with a guest, a new guest | 139 // If the |instance_id| is not yet associated with a guest, a new guest |
139 // will be created. If the |instance_id| has not yet been allocated or the | 140 // will be created. If the |instance_id| has not yet been allocated or the |
140 // embedder is not permitted access to that particular guest, then the | 141 // embedder is not permitted access to that particular guest, then the |
141 // embedder will be killed. | 142 // embedder will be killed. |
142 void Attach(int instance_id); | 143 void Attach(int instance_id); |
143 | 144 |
144 // Notify the plugin about a compositor commit so that frame ACKs could be | 145 // Notify the plugin about a compositor commit so that frame ACKs could be |
145 // sent, if needed. | 146 // sent, if needed. |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 bool UsesPendingDamageBuffer( | 291 bool UsesPendingDamageBuffer( |
291 const BrowserPluginMsg_UpdateRect_Params& params); | 292 const BrowserPluginMsg_UpdateRect_Params& params); |
292 | 293 |
293 void AddPermissionRequestToMap(int request_id, | 294 void AddPermissionRequestToMap(int request_id, |
294 BrowserPluginPermissionType type); | 295 BrowserPluginPermissionType type); |
295 | 296 |
296 // Informs the BrowserPlugin that the guest's permission request has been | 297 // Informs the BrowserPlugin that the guest's permission request has been |
297 // allowed or denied by the embedder. | 298 // allowed or denied by the embedder. |
298 void RespondPermission(BrowserPluginPermissionType permission_type, | 299 void RespondPermission(BrowserPluginPermissionType permission_type, |
299 int request_id, | 300 int request_id, |
300 bool allow); | 301 bool allow, |
| 302 const std::string& user_input); |
301 | 303 |
302 // Handles the response to the pointerLock permission request. | 304 // Handles the response to the pointerLock permission request. |
303 void RespondPermissionPointerLock(bool allow); | 305 void RespondPermissionPointerLock(bool allow); |
304 | 306 |
305 // If the request with id |request_id| is pending then informs the | 307 // If the request with id |request_id| is pending then informs the |
306 // BrowserPlugin that the guest's permission request has been allowed or | 308 // BrowserPlugin that the guest's permission request has been allowed or |
307 // denied by the embedder. | 309 // denied by the embedder. |
308 void RespondPermissionIfRequestIsPending(int request_id, bool allow); | 310 void RespondPermissionIfRequestIsPending(int request_id, |
| 311 bool allow, |
| 312 const std::string& user_input); |
309 | 313 |
310 // Called when the tracked object of |id| ID becomes unreachable in | 314 // Called when the tracked object of |id| ID becomes unreachable in |
311 // JavaScript. | 315 // JavaScript. |
312 void OnTrackedObjectGarbageCollected(int id); | 316 void OnTrackedObjectGarbageCollected(int id); |
313 // V8 garbage collection callback for |object|. | 317 // V8 garbage collection callback for |object|. |
314 static void WeakCallbackForTrackedObject(v8::Isolate* isolate, | 318 static void WeakCallbackForTrackedObject(v8::Isolate* isolate, |
315 v8::Persistent<v8::Value>* object, | 319 v8::Persistent<v8::Value>* object, |
316 void* param); | 320 void* param); |
317 | 321 |
318 // IPC message handlers. | 322 // IPC message handlers. |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_; | 409 base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_; |
406 | 410 |
407 std::vector<EditCommand> edit_commands_; | 411 std::vector<EditCommand> edit_commands_; |
408 | 412 |
409 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); | 413 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); |
410 }; | 414 }; |
411 | 415 |
412 } // namespace content | 416 } // namespace content |
413 | 417 |
414 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 418 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
OLD | NEW |