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 27 matching lines...) Expand all Loading... |
38 #include "third_party/WebKit/public/platform/WebFocusType.h" | 38 #include "third_party/WebKit/public/platform/WebFocusType.h" |
39 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" | 39 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
40 #include "third_party/WebKit/public/web/WebDragOperation.h" | 40 #include "third_party/WebKit/public/web/WebDragOperation.h" |
41 #include "third_party/WebKit/public/web/WebDragStatus.h" | 41 #include "third_party/WebKit/public/web/WebDragStatus.h" |
42 #include "third_party/WebKit/public/web/WebInputEvent.h" | 42 #include "third_party/WebKit/public/web/WebInputEvent.h" |
43 #include "ui/base/ime/text_input_mode.h" | 43 #include "ui/base/ime/text_input_mode.h" |
44 #include "ui/base/ime/text_input_type.h" | 44 #include "ui/base/ime/text_input_type.h" |
45 #include "ui/gfx/geometry/rect.h" | 45 #include "ui/gfx/geometry/rect.h" |
46 | 46 |
47 struct BrowserPluginHostMsg_Attach_Params; | 47 struct BrowserPluginHostMsg_Attach_Params; |
48 struct ViewHostMsg_TextInputState_Params; | |
49 | 48 |
50 #if defined(OS_MACOSX) | 49 #if defined(OS_MACOSX) |
51 struct FrameHostMsg_ShowPopup_Params; | 50 struct FrameHostMsg_ShowPopup_Params; |
52 #endif | 51 #endif |
53 | 52 |
54 namespace cc { | 53 namespace cc { |
55 class CompositorFrame; | 54 class CompositorFrame; |
56 struct SurfaceId; | 55 struct SurfaceId; |
57 struct SurfaceSequence; | 56 struct SurfaceSequence; |
58 } // namespace cc | 57 } // namespace cc |
59 | 58 |
60 namespace gfx { | 59 namespace gfx { |
61 class Range; | 60 class Range; |
62 } // namespace gfx | 61 } // namespace gfx |
63 | 62 |
64 namespace content { | 63 namespace content { |
65 | 64 |
66 class BrowserPluginGuestManager; | 65 class BrowserPluginGuestManager; |
67 class RenderViewHostImpl; | 66 class RenderViewHostImpl; |
68 class RenderWidgetHost; | 67 class RenderWidgetHost; |
69 class RenderWidgetHostView; | 68 class RenderWidgetHostView; |
70 class RenderWidgetHostViewBase; | 69 class RenderWidgetHostViewBase; |
71 class SiteInstance; | 70 class SiteInstance; |
72 struct DropData; | 71 struct DropData; |
| 72 struct TextInputState; |
73 | 73 |
74 // A browser plugin guest provides functionality for WebContents to operate in | 74 // A browser plugin guest provides functionality for WebContents to operate in |
75 // the guest role and implements guest-specific overrides for ViewHostMsg_* | 75 // the guest role and implements guest-specific overrides for ViewHostMsg_* |
76 // messages. | 76 // messages. |
77 // | 77 // |
78 // When a guest is initially created, it is in an unattached state. That is, | 78 // When a guest is initially created, it is in an unattached state. That is, |
79 // it is not visible anywhere and has no embedder WebContents assigned. | 79 // it is not visible anywhere and has no embedder WebContents assigned. |
80 // A BrowserPluginGuest is said to be "attached" if it has an embedder. | 80 // A BrowserPluginGuest is said to be "attached" if it has an embedder. |
81 // A BrowserPluginGuest can also create a new unattached guest via | 81 // A BrowserPluginGuest can also create a new unattached guest via |
82 // CreateNewWindow. The newly created guest will live in the same partition, | 82 // CreateNewWindow. The newly created guest will live in the same partition, |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 // compositing mode, see CCLayerTreeHost::setVisible). | 325 // compositing mode, see CCLayerTreeHost::setVisible). |
326 // | 326 // |
327 // Additionally, it will slow down Javascript execution and garbage | 327 // Additionally, it will slow down Javascript execution and garbage |
328 // collection. See RenderThreadImpl::IdleHandler (executed when hidden) and | 328 // collection. See RenderThreadImpl::IdleHandler (executed when hidden) and |
329 // RenderThreadImpl::IdleHandlerInForegroundTab (executed when visible). | 329 // RenderThreadImpl::IdleHandlerInForegroundTab (executed when visible). |
330 void OnSetVisibility(int instance_id, bool visible); | 330 void OnSetVisibility(int instance_id, bool visible); |
331 void OnUnlockMouse(); | 331 void OnUnlockMouse(); |
332 void OnUnlockMouseAck(int instance_id); | 332 void OnUnlockMouseAck(int instance_id); |
333 void OnUpdateGeometry(int instance_id, const gfx::Rect& view_rect); | 333 void OnUpdateGeometry(int instance_id, const gfx::Rect& view_rect); |
334 | 334 |
335 void OnTextInputStateChanged( | 335 void OnTextInputStateChanged(const TextInputState& params); |
336 const ViewHostMsg_TextInputState_Params& params); | |
337 void OnImeSetComposition( | 336 void OnImeSetComposition( |
338 int instance_id, | 337 int instance_id, |
339 const std::string& text, | 338 const std::string& text, |
340 const std::vector<blink::WebCompositionUnderline>& underlines, | 339 const std::vector<blink::WebCompositionUnderline>& underlines, |
341 int selection_start, | 340 int selection_start, |
342 int selection_end); | 341 int selection_end); |
343 void OnImeConfirmComposition( | 342 void OnImeConfirmComposition( |
344 int instance_id, | 343 int instance_id, |
345 const std::string& text, | 344 const std::string& text, |
346 bool keep_selection); | 345 bool keep_selection); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 gfx::Size last_seen_view_size_; | 418 gfx::Size last_seen_view_size_; |
420 | 419 |
421 bool is_in_destruction_; | 420 bool is_in_destruction_; |
422 | 421 |
423 // BrowserPluginGuest::Init can only be called once. This flag allows it to | 422 // BrowserPluginGuest::Init can only be called once. This flag allows it to |
424 // exit early if it's already been called. | 423 // exit early if it's already been called. |
425 bool initialized_; | 424 bool initialized_; |
426 | 425 |
427 // Text input type states. | 426 // Text input type states. |
428 // Using scoped_ptr to avoid including the header file: view_messages.h. | 427 // Using scoped_ptr to avoid including the header file: view_messages.h. |
429 scoped_ptr<const ViewHostMsg_TextInputState_Params> last_text_input_state_; | 428 scoped_ptr<const TextInputState> last_text_input_state_; |
430 | 429 |
431 // The is the routing ID for a swapped out RenderView for the guest | 430 // The is the routing ID for a swapped out RenderView for the guest |
432 // WebContents in the embedder's process. | 431 // WebContents in the embedder's process. |
433 int guest_proxy_routing_id_; | 432 int guest_proxy_routing_id_; |
434 // Last seen state of drag status update. | 433 // Last seen state of drag status update. |
435 blink::WebDragStatus last_drag_status_; | 434 blink::WebDragStatus last_drag_status_; |
436 // Whether or not our embedder has seen a SystemDragEnded() call. | 435 // Whether or not our embedder has seen a SystemDragEnded() call. |
437 bool seen_embedder_system_drag_ended_; | 436 bool seen_embedder_system_drag_ended_; |
438 // Whether or not our embedder has seen a DragSourceEndedAt() call. | 437 // Whether or not our embedder has seen a DragSourceEndedAt() call. |
439 bool seen_embedder_drag_source_ended_at_; | 438 bool seen_embedder_drag_source_ended_at_; |
(...skipping 10 matching lines...) Expand all Loading... |
450 // Weak pointer used to ask GeolocationPermissionContext about geolocation | 449 // Weak pointer used to ask GeolocationPermissionContext about geolocation |
451 // permission. | 450 // permission. |
452 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; | 451 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; |
453 | 452 |
454 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 453 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
455 }; | 454 }; |
456 | 455 |
457 } // namespace content | 456 } // namespace content |
458 | 457 |
459 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 458 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
OLD | NEW |