Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: content/browser/frame_host/render_widget_host_view_guest.h

Issue 554733003: Browser Plugin: Move input to RWHVGuest to support interstitial pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_to_guest_rect
Patch Set: Pass in RenderWidgetHostImpl instead of WebContents Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" 11 #include "content/browser/frame_host/render_widget_host_view_child_frame.h"
12 #include "content/common/content_export.h" 12 #include "content/common/content_export.h"
13 #include "content/common/cursors/webcursor.h" 13 #include "content/common/cursors/webcursor.h"
14 #include "ui/events/event.h" 14 #include "ui/events/event.h"
15 #include "ui/events/gestures/gesture_recognizer.h" 15 #include "ui/events/gestures/gesture_recognizer.h"
16 #include "ui/events/gestures/gesture_types.h" 16 #include "ui/events/gestures/gesture_types.h"
17 #include "ui/gfx/native_widget_types.h" 17 #include "ui/gfx/native_widget_types.h"
18 #include "ui/gfx/rect.h" 18 #include "ui/gfx/rect.h"
19 #include "ui/gfx/vector2d_f.h" 19 #include "ui/gfx/vector2d_f.h"
20 20
21 struct ViewHostMsg_TextInputState_Params; 21 struct ViewHostMsg_TextInputState_Params;
22 22
23 namespace content { 23 namespace content {
24 class BrowserPluginGuest;
24 class RenderWidgetHost; 25 class RenderWidgetHost;
25 class RenderWidgetHostImpl; 26 class RenderWidgetHostImpl;
26 class BrowserPluginGuest;
27 struct NativeWebKeyboardEvent; 27 struct NativeWebKeyboardEvent;
28 28
29 // See comments in render_widget_host_view.h about this class and its members. 29 // See comments in render_widget_host_view.h about this class and its members.
30 // This version is for the BrowserPlugin which handles a lot of the 30 // This version is for the BrowserPlugin which handles a lot of the
31 // functionality in a diffent place and isn't platform specific. 31 // functionality in a diffent place and isn't platform specific.
32 // The BrowserPlugin is currently a special case for out-of-process rendered 32 // The BrowserPlugin is currently a special case for out-of-process rendered
33 // content and therefore inherits from RenderWidgetHostViewChildFrame. 33 // content and therefore inherits from RenderWidgetHostViewChildFrame.
34 // Eventually all RenderWidgetHostViewGuest code will be subsumed by 34 // Eventually all RenderWidgetHostViewGuest code will be subsumed by
35 // RenderWidgetHostViewChildFrame and this class will be removed. 35 // RenderWidgetHostViewChildFrame and this class will be removed.
36 // 36 //
37 // Some elements that are platform specific will be deal with by delegating 37 // Some elements that are platform specific will be deal with by delegating
38 // the relevant calls to the platform view. 38 // the relevant calls to the platform view.
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 RenderWidgetHostImpl* embedder);
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
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(RenderWidgetHostImpl* embedder,
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_
OLDNEW
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.cc ('k') | content/browser/frame_host/render_widget_host_view_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698