OLD | NEW |
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 BrowserPluginGuest is the browser side of a browser <--> embedder | 5 // A BrowserPluginGuest is the browser side of a browser <--> embedder |
6 // renderer channel. A BrowserPlugin (a WebPlugin) is on the embedder | 6 // renderer channel. A BrowserPlugin (a WebPlugin) is on the embedder |
7 // renderer side of browser <--> embedder renderer communication. | 7 // renderer side of browser <--> embedder renderer communication. |
8 // | 8 // |
9 // BrowserPluginGuest lives on the UI thread of the browser process. Any | 9 // BrowserPluginGuest lives on the UI thread of the browser process. Any |
10 // messages about the guest render process that the embedder might be interested | 10 // messages about the guest render process that the embedder might be interested |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 | 194 |
195 void PointerLockPermissionResponse(bool allow); | 195 void PointerLockPermissionResponse(bool allow); |
196 | 196 |
197 void SwapCompositorFrame(uint32 output_surface_id, | 197 void SwapCompositorFrame(uint32 output_surface_id, |
198 int host_process_id, | 198 int host_process_id, |
199 int host_routing_id, | 199 int host_routing_id, |
200 scoped_ptr<cc::CompositorFrame> frame); | 200 scoped_ptr<cc::CompositorFrame> frame); |
201 | 201 |
202 void SetContentsOpaque(bool opaque); | 202 void SetContentsOpaque(bool opaque); |
203 | 203 |
| 204 // Find the given |search_text| in the page. Returns true if the find request |
| 205 // is handled by this browser plugin guest. |
| 206 bool Find(int request_id, |
| 207 const base::string16& search_text, |
| 208 const blink::WebFindOptions& options); |
| 209 |
204 private: | 210 private: |
205 class EmbedderWebContentsObserver; | 211 class EmbedderWebContentsObserver; |
206 | 212 |
207 // BrowserPluginGuest is a WebContentsObserver of |web_contents| and | 213 // BrowserPluginGuest is a WebContentsObserver of |web_contents| and |
208 // |web_contents| has to stay valid for the lifetime of BrowserPluginGuest. | 214 // |web_contents| has to stay valid for the lifetime of BrowserPluginGuest. |
209 BrowserPluginGuest(bool has_render_view, | 215 BrowserPluginGuest(bool has_render_view, |
210 WebContentsImpl* web_contents, | 216 WebContentsImpl* web_contents, |
211 BrowserPluginGuestDelegate* delegate); | 217 BrowserPluginGuestDelegate* delegate); |
212 | 218 |
213 void WillDestroy(); | 219 void WillDestroy(); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 | 332 |
327 // An identifier that uniquely identifies a browser plugin within an embedder. | 333 // An identifier that uniquely identifies a browser plugin within an embedder. |
328 int browser_plugin_instance_id_; | 334 int browser_plugin_instance_id_; |
329 float guest_device_scale_factor_; | 335 float guest_device_scale_factor_; |
330 gfx::Rect guest_window_rect_; | 336 gfx::Rect guest_window_rect_; |
331 bool focused_; | 337 bool focused_; |
332 bool mouse_locked_; | 338 bool mouse_locked_; |
333 bool pending_lock_request_; | 339 bool pending_lock_request_; |
334 bool guest_visible_; | 340 bool guest_visible_; |
335 bool embedder_visible_; | 341 bool embedder_visible_; |
| 342 // Whether the browser plugin is inside a plugin document. |
| 343 bool is_full_page_plugin_; |
336 | 344 |
337 // Each copy-request is identified by a unique number. The unique number is | 345 // Each copy-request is identified by a unique number. The unique number is |
338 // used to keep track of the right callback. | 346 // used to keep track of the right callback. |
339 int copy_request_id_; | 347 int copy_request_id_; |
340 typedef base::Callback<void(bool, const SkBitmap&)> CopyRequestCallback; | 348 typedef base::Callback<void(bool, const SkBitmap&)> CopyRequestCallback; |
341 typedef std::map<int, const CopyRequestCallback> CopyRequestMap; | 349 typedef std::map<int, const CopyRequestCallback> CopyRequestMap; |
342 CopyRequestMap copy_request_callbacks_; | 350 CopyRequestMap copy_request_callbacks_; |
343 | 351 |
344 // Indicates that this BrowserPluginGuest has associated renderer-side state. | 352 // Indicates that this BrowserPluginGuest has associated renderer-side state. |
345 // This is used to determine whether or not to create a new RenderView when | 353 // This is used to determine whether or not to create a new RenderView when |
(...skipping 27 matching lines...) Expand all Loading... |
373 // Weak pointer used to ask GeolocationPermissionContext about geolocation | 381 // Weak pointer used to ask GeolocationPermissionContext about geolocation |
374 // permission. | 382 // permission. |
375 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; | 383 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; |
376 | 384 |
377 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 385 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
378 }; | 386 }; |
379 | 387 |
380 } // namespace content | 388 } // namespace content |
381 | 389 |
382 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 390 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
OLD | NEW |