| 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 27 matching lines...) Expand all Loading... |
| 38 // content and therefore inherits from RenderWidgetHostViewChildFrame. | 38 // content and therefore inherits from RenderWidgetHostViewChildFrame. |
| 39 // Eventually all RenderWidgetHostViewGuest code will be subsumed by | 39 // Eventually all RenderWidgetHostViewGuest code will be subsumed by |
| 40 // RenderWidgetHostViewChildFrame and this class will be removed. | 40 // RenderWidgetHostViewChildFrame and this class will be removed. |
| 41 // | 41 // |
| 42 // Some elements that are platform specific will be deal with by delegating | 42 // Some elements that are platform specific will be deal with by delegating |
| 43 // the relevant calls to the platform view. | 43 // the relevant calls to the platform view. |
| 44 class CONTENT_EXPORT RenderWidgetHostViewGuest | 44 class CONTENT_EXPORT RenderWidgetHostViewGuest |
| 45 : public RenderWidgetHostViewChildFrame, | 45 : public RenderWidgetHostViewChildFrame, |
| 46 public ui::GestureConsumer { | 46 public ui::GestureConsumer { |
| 47 public: | 47 public: |
| 48 RenderWidgetHostViewGuest( | 48 static RenderWidgetHostViewGuest* Create( |
| 49 RenderWidgetHost* widget, | 49 RenderWidgetHost* widget, |
| 50 BrowserPluginGuest* guest, | 50 BrowserPluginGuest* guest, |
| 51 base::WeakPtr<RenderWidgetHostViewBase> platform_view); | 51 base::WeakPtr<RenderWidgetHostViewBase> platform_view); |
| 52 ~RenderWidgetHostViewGuest() override; | 52 ~RenderWidgetHostViewGuest() override; |
| 53 | 53 |
| 54 bool OnMessageReceivedFromEmbedder(const IPC::Message& message, | 54 bool OnMessageReceivedFromEmbedder(const IPC::Message& message, |
| 55 RenderWidgetHostImpl* embedder); | 55 RenderWidgetHostImpl* embedder); |
| 56 | 56 |
| 57 // RenderWidgetHostView implementation. | 57 // RenderWidgetHostView implementation. |
| 58 bool OnMessageReceived(const IPC::Message& msg) override; | 58 bool OnMessageReceived(const IPC::Message& msg) override; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 130 |
| 131 protected: | 131 protected: |
| 132 friend class RenderWidgetHostView; | 132 friend class RenderWidgetHostView; |
| 133 | 133 |
| 134 private: | 134 private: |
| 135 RenderWidgetHostViewGuest( |
| 136 RenderWidgetHost* widget, |
| 137 BrowserPluginGuest* guest, |
| 138 base::WeakPtr<RenderWidgetHostViewBase> platform_view); |
| 139 |
| 135 RenderWidgetHostViewBase* GetOwnerRenderWidgetHostView() const; | 140 RenderWidgetHostViewBase* GetOwnerRenderWidgetHostView() const; |
| 136 | 141 |
| 137 // Since we now route GestureEvents directly to the guest renderer, we need | 142 // Since we now route GestureEvents directly to the guest renderer, we need |
| 138 // a way to make sure that the BrowserPlugin in the embedder gets focused so | 143 // a way to make sure that the BrowserPlugin in the embedder gets focused so |
| 139 // that keyboard input (which still travels via BrowserPlugin) is routed to | 144 // that keyboard input (which still travels via BrowserPlugin) is routed to |
| 140 // the plugin and thus onwards to the guest. | 145 // the plugin and thus onwards to the guest. |
| 141 // TODO(wjmaclean): When we remove BrowserPlugin, delete this code. | 146 // TODO(wjmaclean): When we remove BrowserPlugin, delete this code. |
| 142 // http://crbug.com/533069 | 147 // http://crbug.com/533069 |
| 143 void MaybeSendSyntheticTapGesture( | 148 void MaybeSendSyntheticTapGesture( |
| 144 const blink::WebFloatPoint& position, | 149 const blink::WebFloatPoint& position, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 155 // The platform view for this RenderWidgetHostView. | 160 // The platform view for this RenderWidgetHostView. |
| 156 // RenderWidgetHostViewGuest mostly only cares about stuff related to | 161 // RenderWidgetHostViewGuest mostly only cares about stuff related to |
| 157 // compositing, the rest are directly forwarded to this |platform_view_|. | 162 // compositing, the rest are directly forwarded to this |platform_view_|. |
| 158 base::WeakPtr<RenderWidgetHostViewBase> platform_view_; | 163 base::WeakPtr<RenderWidgetHostViewBase> platform_view_; |
| 159 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewGuest); | 164 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewGuest); |
| 160 }; | 165 }; |
| 161 | 166 |
| 162 } // namespace content | 167 } // namespace content |
| 163 | 168 |
| 164 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_ | 169 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_ |
| OLD | NEW |