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