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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 class CONTENT_EXPORT RenderWidgetHostViewGuest | 39 class CONTENT_EXPORT RenderWidgetHostViewGuest |
40 : public RenderWidgetHostViewChildFrame, | 40 : public RenderWidgetHostViewChildFrame, |
41 public ui::GestureConsumer, | 41 public ui::GestureConsumer, |
42 public ui::GestureEventHelper { | 42 public ui::GestureEventHelper { |
43 public: | 43 public: |
44 RenderWidgetHostViewGuest(RenderWidgetHost* widget, | 44 RenderWidgetHostViewGuest(RenderWidgetHost* widget, |
45 BrowserPluginGuest* guest, | 45 BrowserPluginGuest* guest, |
46 RenderWidgetHostViewBase* platform_view); | 46 RenderWidgetHostViewBase* platform_view); |
47 virtual ~RenderWidgetHostViewGuest(); | 47 virtual ~RenderWidgetHostViewGuest(); |
48 | 48 |
| 49 bool OnMessageReceivedFromEmbedder(const IPC::Message& message); |
| 50 |
49 // RenderWidgetHostView implementation. | 51 // RenderWidgetHostView implementation. |
50 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 52 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
51 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE; | 53 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE; |
52 virtual void SetSize(const gfx::Size& size) OVERRIDE; | 54 virtual void SetSize(const gfx::Size& size) OVERRIDE; |
53 virtual void SetBounds(const gfx::Rect& rect) OVERRIDE; | 55 virtual void SetBounds(const gfx::Rect& rect) OVERRIDE; |
54 virtual gfx::NativeView GetNativeView() const OVERRIDE; | 56 virtual gfx::NativeView GetNativeView() const OVERRIDE; |
55 virtual gfx::NativeViewId GetNativeViewId() const OVERRIDE; | 57 virtual gfx::NativeViewId GetNativeViewId() const OVERRIDE; |
56 virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE; | 58 virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE; |
57 virtual gfx::Rect GetViewBounds() const OVERRIDE; | 59 virtual gfx::Rect GetViewBounds() const OVERRIDE; |
58 virtual void SetBackgroundOpaque(bool opaque) OVERRIDE; | 60 virtual void SetBackgroundOpaque(bool opaque) OVERRIDE; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 void DestroyGuestView(); | 158 void DestroyGuestView(); |
157 | 159 |
158 // Builds and forwards a WebKitGestureEvent to the renderer. | 160 // Builds and forwards a WebKitGestureEvent to the renderer. |
159 bool ForwardGestureEventToRenderer(ui::GestureEvent* gesture); | 161 bool ForwardGestureEventToRenderer(ui::GestureEvent* gesture); |
160 | 162 |
161 // Process all of the given gestures (passes them on to renderer) | 163 // Process all of the given gestures (passes them on to renderer) |
162 void ProcessGestures(ui::GestureRecognizer::Gestures* gestures); | 164 void ProcessGestures(ui::GestureRecognizer::Gestures* gestures); |
163 | 165 |
164 RenderWidgetHostViewBase* GetGuestRenderWidgetHostView() const; | 166 RenderWidgetHostViewBase* GetGuestRenderWidgetHostView() const; |
165 | 167 |
| 168 void OnHandleInputEvent(int browser_plugin_instance_id, |
| 169 const gfx::Rect& guest_window_rect, |
| 170 const blink::WebInputEvent* event); |
| 171 |
166 // BrowserPluginGuest and RenderWidgetHostViewGuest's lifetimes are not tied | 172 // BrowserPluginGuest and RenderWidgetHostViewGuest's lifetimes are not tied |
167 // to one another, therefore we access |guest_| through WeakPtr. | 173 // to one another, therefore we access |guest_| through WeakPtr. |
168 base::WeakPtr<BrowserPluginGuest> guest_; | 174 base::WeakPtr<BrowserPluginGuest> guest_; |
169 gfx::Size size_; | 175 gfx::Size size_; |
170 // The platform view for this RenderWidgetHostView. | 176 // The platform view for this RenderWidgetHostView. |
171 // RenderWidgetHostViewGuest mostly only cares about stuff related to | 177 // RenderWidgetHostViewGuest mostly only cares about stuff related to |
172 // compositing, the rest are directly forwared to this |platform_view_|. | 178 // compositing, the rest are directly forwared to this |platform_view_|. |
173 RenderWidgetHostViewBase* platform_view_; | 179 RenderWidgetHostViewBase* platform_view_; |
174 #if defined(USE_AURA) | 180 #if defined(USE_AURA) |
175 scoped_ptr<ui::GestureRecognizer> gesture_recognizer_; | 181 scoped_ptr<ui::GestureRecognizer> gesture_recognizer_; |
176 #endif | 182 #endif |
177 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewGuest); | 183 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewGuest); |
178 }; | 184 }; |
179 | 185 |
180 } // namespace content | 186 } // namespace content |
181 | 187 |
182 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_ | 188 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_ |
OLD | NEW |