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