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 12 matching lines...) Expand all Loading... |
23 | 23 |
24 #include "base/compiler_specific.h" | 24 #include "base/compiler_specific.h" |
25 #include "base/memory/linked_ptr.h" | 25 #include "base/memory/linked_ptr.h" |
26 #include "base/memory/weak_ptr.h" | 26 #include "base/memory/weak_ptr.h" |
27 #include "base/values.h" | 27 #include "base/values.h" |
28 #include "content/common/edit_command.h" | 28 #include "content/common/edit_command.h" |
29 #include "content/common/input/input_event_ack_state.h" | 29 #include "content/common/input/input_event_ack_state.h" |
30 #include "content/public/browser/browser_plugin_guest_delegate.h" | 30 #include "content/public/browser/browser_plugin_guest_delegate.h" |
31 #include "content/public/browser/readback_types.h" | 31 #include "content/public/browser/readback_types.h" |
32 #include "content/public/browser/web_contents_observer.h" | 32 #include "content/public/browser/web_contents_observer.h" |
| 33 #include "third_party/WebKit/public/platform/WebFocusType.h" |
33 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" | 34 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
34 #include "third_party/WebKit/public/web/WebDragOperation.h" | 35 #include "third_party/WebKit/public/web/WebDragOperation.h" |
35 #include "third_party/WebKit/public/web/WebDragStatus.h" | 36 #include "third_party/WebKit/public/web/WebDragStatus.h" |
36 #include "third_party/WebKit/public/web/WebInputEvent.h" | 37 #include "third_party/WebKit/public/web/WebInputEvent.h" |
37 #include "ui/base/ime/text_input_mode.h" | 38 #include "ui/base/ime/text_input_mode.h" |
38 #include "ui/base/ime/text_input_type.h" | 39 #include "ui/base/ime/text_input_type.h" |
39 #include "ui/gfx/geometry/rect.h" | 40 #include "ui/gfx/geometry/rect.h" |
40 | 41 |
41 class GuestSizer; | 42 class GuestSizer; |
42 class SkBitmap; | 43 class SkBitmap; |
43 struct BrowserPluginHostMsg_Attach_Params; | 44 struct BrowserPluginHostMsg_Attach_Params; |
44 struct BrowserPluginHostMsg_ResizeGuest_Params; | 45 struct BrowserPluginHostMsg_ResizeGuest_Params; |
45 struct FrameHostMsg_CompositorFrameSwappedACK_Params; | 46 struct FrameHostMsg_CompositorFrameSwappedACK_Params; |
46 struct FrameHostMsg_ReclaimCompositorResources_Params; | 47 struct FrameHostMsg_ReclaimCompositorResources_Params; |
47 struct FrameMsg_CompositorFrameSwapped_Params; | 48 struct FrameMsg_CompositorFrameSwapped_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 blink { | |
54 class WebInputEvent; | |
55 } // namespace blink | |
56 | |
57 namespace cc { | 54 namespace cc { |
58 class CompositorFrame; | 55 class CompositorFrame; |
59 } // namespace cc | 56 } // namespace cc |
60 | 57 |
61 namespace gfx { | 58 namespace gfx { |
62 class Range; | 59 class Range; |
63 } // namespace gfx | 60 } // namespace gfx |
64 | 61 |
65 namespace content { | 62 namespace content { |
66 | 63 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // container, then this call is a no-op. For guest types that can be | 104 // container, then this call is a no-op. For guest types that can be |
108 // navigated, this call adds the associated RenderWdigetHostViewGuest to the | 105 // navigated, this call adds the associated RenderWdigetHostViewGuest to the |
109 // view hierachy and sets up the appropriate RendererPreferences so that this | 106 // view hierachy and sets up the appropriate RendererPreferences so that this |
110 // guest can navigate and resize offscreen. | 107 // guest can navigate and resize offscreen. |
111 void Init(); | 108 void Init(); |
112 | 109 |
113 // Returns a WeakPtr to this BrowserPluginGuest. | 110 // Returns a WeakPtr to this BrowserPluginGuest. |
114 base::WeakPtr<BrowserPluginGuest> AsWeakPtr(); | 111 base::WeakPtr<BrowserPluginGuest> AsWeakPtr(); |
115 | 112 |
116 // Sets the focus state of the current RenderWidgetHostView. | 113 // Sets the focus state of the current RenderWidgetHostView. |
117 void SetFocus(RenderWidgetHost* rwh, bool focused); | 114 void SetFocus(RenderWidgetHost* rwh, |
| 115 bool focused, |
| 116 blink::WebFocusType focus_type); |
118 | 117 |
119 // Sets the tooltip text. | 118 // Sets the tooltip text. |
120 void SetTooltipText(const base::string16& tooltip_text); | 119 void SetTooltipText(const base::string16& tooltip_text); |
121 | 120 |
122 // Sets the lock state of the pointer. Returns true if |allowed| is true and | 121 // Sets the lock state of the pointer. Returns true if |allowed| is true and |
123 // the mouse has been successfully locked. | 122 // the mouse has been successfully locked. |
124 bool LockMouse(bool allowed); | 123 bool LockMouse(bool allowed); |
125 | 124 |
126 // Return true if the mouse is locked. | 125 // Return true if the mouse is locked. |
127 bool mouse_locked() const { return mouse_locked_; } | 126 bool mouse_locked() const { return mouse_locked_; } |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 const FrameHostMsg_ReclaimCompositorResources_Params& params); | 260 const FrameHostMsg_ReclaimCompositorResources_Params& params); |
262 | 261 |
263 void OnLockMouse(bool user_gesture, | 262 void OnLockMouse(bool user_gesture, |
264 bool last_unlocked_by_target, | 263 bool last_unlocked_by_target, |
265 bool privileged); | 264 bool privileged); |
266 void OnLockMouseAck(int instance_id, bool succeeded); | 265 void OnLockMouseAck(int instance_id, bool succeeded); |
267 // Resizes the guest's web contents. | 266 // Resizes the guest's web contents. |
268 void OnResizeGuest( | 267 void OnResizeGuest( |
269 int browser_plugin_instance_id, | 268 int browser_plugin_instance_id, |
270 const BrowserPluginHostMsg_ResizeGuest_Params& params); | 269 const BrowserPluginHostMsg_ResizeGuest_Params& params); |
271 void OnSetFocus(int instance_id, bool focused); | 270 void OnSetFocus(int instance_id, |
| 271 bool focused, |
| 272 blink::WebFocusType focus_type); |
272 // Sets the name of the guest so that other guests in the same partition can | 273 // Sets the name of the guest so that other guests in the same partition can |
273 // access it. | 274 // access it. |
274 void OnSetName(int instance_id, const std::string& name); | 275 void OnSetName(int instance_id, const std::string& name); |
275 // Updates the size state of the guest. | 276 // Updates the size state of the guest. |
276 void OnSetEditCommandsForNextKeyEvent( | 277 void OnSetEditCommandsForNextKeyEvent( |
277 int instance_id, | 278 int instance_id, |
278 const std::vector<EditCommand>& edit_commands); | 279 const std::vector<EditCommand>& edit_commands); |
279 // The guest WebContents is visible if both its embedder is visible and | 280 // The guest WebContents is visible if both its embedder is visible and |
280 // the browser plugin element is visible. If either one is not then the | 281 // the browser plugin element is visible. If either one is not then the |
281 // WebContents is marked as hidden. A hidden WebContents will consume | 282 // WebContents is marked as hidden. A hidden WebContents will consume |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 // Weak pointer used to ask GeolocationPermissionContext about geolocation | 406 // Weak pointer used to ask GeolocationPermissionContext about geolocation |
406 // permission. | 407 // permission. |
407 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; | 408 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; |
408 | 409 |
409 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 410 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
410 }; | 411 }; |
411 | 412 |
412 } // namespace content | 413 } // namespace content |
413 | 414 |
414 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 415 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
OLD | NEW |