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; |
48 | 49 |
49 #if defined(OS_MACOSX) | 50 #if defined(OS_MACOSX) |
50 struct FrameHostMsg_ShowPopup_Params; | 51 struct FrameHostMsg_ShowPopup_Params; |
51 #endif | 52 #endif |
52 | 53 |
53 namespace cc { | 54 namespace cc { |
54 class CompositorFrame; | 55 class CompositorFrame; |
55 struct SurfaceId; | 56 struct SurfaceId; |
56 struct SurfaceSequence; | 57 struct SurfaceSequence; |
57 } // namespace cc | 58 } // namespace cc |
58 | 59 |
59 namespace gfx { | 60 namespace gfx { |
60 class Range; | 61 class Range; |
61 } // namespace gfx | 62 } // namespace gfx |
62 | 63 |
63 namespace content { | 64 namespace content { |
64 | 65 |
65 class BrowserPluginGuestManager; | 66 class BrowserPluginGuestManager; |
66 class RenderViewHostImpl; | 67 class RenderViewHostImpl; |
67 class RenderWidgetHost; | 68 class RenderWidgetHost; |
68 class RenderWidgetHostView; | 69 class RenderWidgetHostView; |
69 class RenderWidgetHostViewBase; | 70 class RenderWidgetHostViewBase; |
70 class SiteInstance; | 71 class SiteInstance; |
71 struct DropData; | 72 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(const TextInputState& params); | 335 void OnTextInputStateChanged( |
| 336 const ViewHostMsg_TextInputState_Params& params); |
336 void OnImeSetComposition( | 337 void OnImeSetComposition( |
337 int instance_id, | 338 int instance_id, |
338 const std::string& text, | 339 const std::string& text, |
339 const std::vector<blink::WebCompositionUnderline>& underlines, | 340 const std::vector<blink::WebCompositionUnderline>& underlines, |
340 int selection_start, | 341 int selection_start, |
341 int selection_end); | 342 int selection_end); |
342 void OnImeConfirmComposition( | 343 void OnImeConfirmComposition( |
343 int instance_id, | 344 int instance_id, |
344 const std::string& text, | 345 const std::string& text, |
345 bool keep_selection); | 346 bool keep_selection); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 gfx::Size last_seen_view_size_; | 419 gfx::Size last_seen_view_size_; |
419 | 420 |
420 bool is_in_destruction_; | 421 bool is_in_destruction_; |
421 | 422 |
422 // BrowserPluginGuest::Init can only be called once. This flag allows it to | 423 // BrowserPluginGuest::Init can only be called once. This flag allows it to |
423 // exit early if it's already been called. | 424 // exit early if it's already been called. |
424 bool initialized_; | 425 bool initialized_; |
425 | 426 |
426 // Text input type states. | 427 // Text input type states. |
427 // Using scoped_ptr to avoid including the header file: view_messages.h. | 428 // Using scoped_ptr to avoid including the header file: view_messages.h. |
428 // TODO(ekaramad): The text input state tracking is now done by the | 429 std::unique_ptr<const ViewHostMsg_TextInputState_Params> |
429 // WebContentsImpl. We should remove this variable (crbug.com/602427). | 430 last_text_input_state_; |
430 std::unique_ptr<const TextInputState> last_text_input_state_; | |
431 | 431 |
432 // The is the routing ID for a swapped out RenderView for the guest | 432 // The is the routing ID for a swapped out RenderView for the guest |
433 // WebContents in the embedder's process. | 433 // WebContents in the embedder's process. |
434 int guest_proxy_routing_id_; | 434 int guest_proxy_routing_id_; |
435 // Last seen state of drag status update. | 435 // Last seen state of drag status update. |
436 blink::WebDragStatus last_drag_status_; | 436 blink::WebDragStatus last_drag_status_; |
437 // Whether or not our embedder has seen a SystemDragEnded() call. | 437 // Whether or not our embedder has seen a SystemDragEnded() call. |
438 bool seen_embedder_system_drag_ended_; | 438 bool seen_embedder_system_drag_ended_; |
439 // Whether or not our embedder has seen a DragSourceEndedAt() call. | 439 // Whether or not our embedder has seen a DragSourceEndedAt() call. |
440 bool seen_embedder_drag_source_ended_at_; | 440 bool seen_embedder_drag_source_ended_at_; |
(...skipping 10 matching lines...) Expand all Loading... |
451 // Weak pointer used to ask GeolocationPermissionContext about geolocation | 451 // Weak pointer used to ask GeolocationPermissionContext about geolocation |
452 // permission. | 452 // permission. |
453 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; | 453 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; |
454 | 454 |
455 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 455 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
456 }; | 456 }; |
457 | 457 |
458 } // namespace content | 458 } // namespace content |
459 | 459 |
460 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 460 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
OLD | NEW |