OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 void LockCompositingSurface() override; | 119 void LockCompositingSurface() override; |
120 void UnlockCompositingSurface() override; | 120 void UnlockCompositingSurface() override; |
121 | 121 |
122 void WheelEventAck(const blink::WebMouseWheelEvent& event, | 122 void WheelEventAck(const blink::WebMouseWheelEvent& event, |
123 InputEventAckState ack_result) override; | 123 InputEventAckState ack_result) override; |
124 | 124 |
125 void GestureEventAck(const blink::WebGestureEvent& event, | 125 void GestureEventAck(const blink::WebGestureEvent& event, |
126 InputEventAckState ack_result) override; | 126 InputEventAckState ack_result) override; |
127 | 127 |
128 bool IsRenderWidgetHostViewGuest() override; | 128 bool IsRenderWidgetHostViewGuest() override; |
| 129 RenderWidgetHostViewBase* GetOwnerRenderWidgetHostView() const; |
129 | 130 |
130 protected: | 131 protected: |
131 friend class RenderWidgetHostView; | 132 friend class RenderWidgetHostView; |
132 | 133 |
133 private: | 134 private: |
134 RenderWidgetHostViewGuest( | 135 RenderWidgetHostViewGuest( |
135 RenderWidgetHost* widget, | 136 RenderWidgetHost* widget, |
136 BrowserPluginGuest* guest, | 137 BrowserPluginGuest* guest, |
137 base::WeakPtr<RenderWidgetHostViewBase> platform_view); | 138 base::WeakPtr<RenderWidgetHostViewBase> platform_view); |
138 | 139 |
139 RenderWidgetHostViewBase* GetOwnerRenderWidgetHostView() const; | |
140 | |
141 // Since we now route GestureEvents directly to the guest renderer, we need | 140 // Since we now route GestureEvents directly to the guest renderer, we need |
142 // a way to make sure that the BrowserPlugin in the embedder gets focused so | 141 // a way to make sure that the BrowserPlugin in the embedder gets focused so |
143 // that keyboard input (which still travels via BrowserPlugin) is routed to | 142 // that keyboard input (which still travels via BrowserPlugin) is routed to |
144 // the plugin and thus onwards to the guest. | 143 // the plugin and thus onwards to the guest. |
145 // TODO(wjmaclean): When we remove BrowserPlugin, delete this code. | 144 // TODO(wjmaclean): When we remove BrowserPlugin, delete this code. |
146 // http://crbug.com/533069 | 145 // http://crbug.com/533069 |
147 void MaybeSendSyntheticTapGesture( | 146 void MaybeSendSyntheticTapGesture( |
148 const blink::WebFloatPoint& position, | 147 const blink::WebFloatPoint& position, |
149 const blink::WebFloatPoint& screenPosition) const; | 148 const blink::WebFloatPoint& screenPosition) const; |
150 | 149 |
151 void OnHandleInputEvent(RenderWidgetHostImpl* embedder, | 150 void OnHandleInputEvent(RenderWidgetHostImpl* embedder, |
152 int browser_plugin_instance_id, | 151 int browser_plugin_instance_id, |
153 const blink::WebInputEvent* event); | 152 const blink::WebInputEvent* event); |
154 | 153 |
155 // BrowserPluginGuest and RenderWidgetHostViewGuest's lifetimes are not tied | 154 // BrowserPluginGuest and RenderWidgetHostViewGuest's lifetimes are not tied |
156 // to one another, therefore we access |guest_| through WeakPtr. | 155 // to one another, therefore we access |guest_| through WeakPtr. |
157 base::WeakPtr<BrowserPluginGuest> guest_; | 156 base::WeakPtr<BrowserPluginGuest> guest_; |
158 gfx::Size size_; | 157 gfx::Size size_; |
159 // The platform view for this RenderWidgetHostView. | 158 // The platform view for this RenderWidgetHostView. |
160 // RenderWidgetHostViewGuest mostly only cares about stuff related to | 159 // RenderWidgetHostViewGuest mostly only cares about stuff related to |
161 // compositing, the rest are directly forwarded to this |platform_view_|. | 160 // compositing, the rest are directly forwarded to this |platform_view_|. |
162 base::WeakPtr<RenderWidgetHostViewBase> platform_view_; | 161 base::WeakPtr<RenderWidgetHostViewBase> platform_view_; |
163 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewGuest); | 162 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewGuest); |
164 }; | 163 }; |
165 | 164 |
166 } // namespace content | 165 } // namespace content |
167 | 166 |
168 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_ | 167 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_ |
OLD | NEW |