libchromiumcontent/patches/028-render_widget_host_view...

103 строки
4.8 KiB
Diff

diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc
index 98460d7a89e9..67dba849df43 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.cc
+++ b/content/browser/renderer_host/render_widget_host_view_base.cc
@@ -406,6 +406,36 @@ cc::FrameSinkId RenderWidgetHostViewBase::FrameSinkIdAtPoint(
return viz::FrameSinkId();
}
+void RenderWidgetHostViewBase::ProcessKeyboardEvent(
+ const NativeWebKeyboardEvent& event,
+ const ui::LatencyInfo& latency) {
+ if (!GetRenderWidgetHost()) return;
+ GetRenderWidgetHost()->ForwardKeyboardEvent(event);
+}
+
+void RenderWidgetHostViewBase::ProcessMouseEvent(
+ const blink::WebMouseEvent& event,
+ const ui::LatencyInfo& latency) {
+ if (!GetRenderWidgetHost()) return;
+ GetRenderWidgetHost()->ForwardMouseEvent(event);
+}
+
+void RenderWidgetHostViewBase::ProcessMouseWheelEvent(
+ const blink::WebMouseWheelEvent& event,
+ const ui::LatencyInfo& latency) {
+ if (!GetRenderWidgetHost()) return;
+ GetRenderWidgetHost()->ForwardWheelEvent(event);
+}
+
+RenderWidgetHostViewBase* RenderWidgetHostViewBase::CreateViewForWidget(
+ RenderWidgetHost* render_widget_host,
+ RenderWidgetHost* embedder_render_widget_host,
+ WebContentsView* web_contents_view) {
+ return web_contents_view->CreateViewForWidget(
+ render_widget_host,
+ !!embedder_render_widget_host);
+}
+
gfx::Point RenderWidgetHostViewBase::TransformPointToRootCoordSpace(
const gfx::Point& point) {
return point;
diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h
index 657ad20..47920a9 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.h
+++ b/content/browser/renderer_host/render_widget_host_view_base.h
@@ -22,8 +22,10 @@
#include "cc/output/compositor_frame.h"
#include "components/viz/common/surfaces/surface_id.h"
#include "content/browser/renderer_host/event_with_latency_info.h"
+#include "content/browser/web_contents/web_contents_view.h"
#include "content/common/content_export.h"
#include "content/common/input/input_event_ack_state.h"
+#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/common/screen_info.h"
#include "ipc/ipc_listener.h"
@@ -76,8 +78,10 @@ class BrowserAccessibilityDelegate;
class CursorManager;
class RenderWidgetHostImpl;
class RenderWidgetHostViewBaseObserver;
+class RenderWidgetHostViewGuest;
class SyntheticGestureTarget;
class TextInputManager;
+class WebContentsView;
class TouchSelectionControllerClientManager;
class WebContentsAccessibility;
class WebCursor;
@@ -120,6 +124,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
TouchSelectionControllerClientManager*
GetTouchSelectionControllerClientManager() override;
+ virtual void InitAsGuest(RenderWidgetHostView* parent_host_view,
+ RenderWidgetHostViewGuest* guest_view) {}
+
// This only needs to be overridden by RenderWidgetHostViewBase subclasses
// that handle content embedded within other RenderWidgetHostViews.
gfx::Point TransformPointToRootCoordSpace(const gfx::Point& point) override;
@@ -265,16 +272,21 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
const gfx::Point& point,
gfx::Point* transformed_point);
virtual void ProcessKeyboardEvent(const NativeWebKeyboardEvent& event,
- const ui::LatencyInfo& latency) {}
+ const ui::LatencyInfo& latency);
virtual void ProcessMouseEvent(const blink::WebMouseEvent& event,
- const ui::LatencyInfo& latency) {}
+ const ui::LatencyInfo& latency);
virtual void ProcessMouseWheelEvent(const blink::WebMouseWheelEvent& event,
- const ui::LatencyInfo& latency) {}
+ const ui::LatencyInfo& latency);
virtual void ProcessTouchEvent(const blink::WebTouchEvent& event,
const ui::LatencyInfo& latency) {}
virtual void ProcessGestureEvent(const blink::WebGestureEvent& event,
const ui::LatencyInfo& latency) {}
+ virtual RenderWidgetHostViewBase* CreateViewForWidget(
+ RenderWidgetHost* render_widget_host,
+ RenderWidgetHost* embedder_render_widget_host,
+ WebContentsView* web_contents_view);
+
// Transform a point that is in the coordinate space of a Surface that is
// embedded within the RenderWidgetHostViewBase's Surface to the
// coordinate space of an embedding, or embedded, Surface. Typically this