Chromium Code Reviews| Index: content/browser/frame_host/render_widget_host_view_child_frame.h |
| diff --git a/content/browser/renderer_host/render_widget_host_view_guest.h b/content/browser/frame_host/render_widget_host_view_child_frame.h |
| similarity index 70% |
| copy from content/browser/renderer_host/render_widget_host_view_guest.h |
| copy to content/browser/frame_host/render_widget_host_view_child_frame.h |
| index 933c83b5525b822a2e63fb5ad939fb0338cf943e..b8990745e5c905b1bf7ec99f262192adc2e55845 100644 |
| --- a/content/browser/renderer_host/render_widget_host_view_guest.h |
| +++ b/content/browser/frame_host/render_widget_host_view_child_frame.h |
| @@ -1,67 +1,57 @@ |
| -// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_ |
| -#define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_ |
| - |
| -#include <vector> |
| +#ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ |
| +#define CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ |
| #include "base/memory/scoped_ptr.h" |
| #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| #include "content/common/content_export.h" |
| -#include "ui/events/event.h" |
| -#include "ui/events/gestures/gesture_recognizer.h" |
| -#include "ui/events/gestures/gesture_types.h" |
| #include "ui/gfx/native_widget_types.h" |
| #include "ui/gfx/rect.h" |
| -#include "ui/gfx/vector2d_f.h" |
| -#include "webkit/common/cursors/webcursor.h" |
| - |
| -#if defined(TOOLKIT_GTK) |
| -#include "content/browser/renderer_host/gtk_plugin_container_manager.h" |
| -#endif // defined(TOOLKIT_GTK) |
| namespace content { |
| +class CrossProcessFrameConnector; |
| class RenderWidgetHost; |
| class RenderWidgetHostImpl; |
| -class BrowserPluginGuest; |
| -struct NativeWebKeyboardEvent; |
| -// ----------------------------------------------------------------------------- |
| -// See comments in render_widget_host_view.h about this class and its members. |
| -// This version is for the webview plugin which handles a lot of the |
| -// functionality in a diffent place and isn't platform specific. |
| +// RenderWidgetHostViewChildFrame implements the view for a RenderWidgetHost |
| +// associated with content being rendered in a separate process from |
| +// content that is embedding it. This is not a platform-specific class; rather, |
| +// the embedding renderer process implements the platform containing the |
| +// widget, and the top-level frame's RenderWidgetHostView will ultimately |
| +// manage all native widget interaction. |
| // |
| -// Some elements that are platform specific will be deal with by delegating |
| -// the relevant calls to the platform view. |
| -// ----------------------------------------------------------------------------- |
| -class CONTENT_EXPORT RenderWidgetHostViewGuest |
| - : public RenderWidgetHostViewBase, |
| - public ui::GestureConsumer, |
| - public ui::GestureEventHelper { |
| +// See comments in render_widget_host_view.h about this class and its members. |
| +class CONTENT_EXPORT RenderWidgetHostViewChildFrame |
| + : public RenderWidgetHostViewBase { |
| public: |
| - RenderWidgetHostViewGuest(RenderWidgetHost* widget, |
| - BrowserPluginGuest* guest, |
| - RenderWidgetHostView* platform_view); |
| - virtual ~RenderWidgetHostViewGuest(); |
| + RenderWidgetHostViewChildFrame(RenderWidgetHost* widget); |
|
sadrul
2014/01/03 15:22:10
explicit?
awong
2014/01/03 19:54:33
Done.
|
| + virtual ~RenderWidgetHostViewChildFrame(); |
| + |
| + void set_cross_process_child_frame( |
| + CrossProcessFrameConnector* frame_connector) { |
| + frame_connector_ = frame_connector; |
| + } |
| // RenderWidgetHostView implementation. |
| - virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
| virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE; |
| virtual RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE; |
| virtual void SetSize(const gfx::Size& size) OVERRIDE; |
| virtual void SetBounds(const gfx::Rect& rect) OVERRIDE; |
| - virtual gfx::NativeView GetNativeView() const OVERRIDE; |
| - virtual gfx::NativeViewId GetNativeViewId() const OVERRIDE; |
| - virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE; |
| + virtual void Focus() OVERRIDE; |
| virtual bool HasFocus() const OVERRIDE; |
| virtual bool IsSurfaceAvailableForCopy() const OVERRIDE; |
| virtual void Show() OVERRIDE; |
| virtual void Hide() OVERRIDE; |
| virtual bool IsShowing() OVERRIDE; |
| virtual gfx::Rect GetViewBounds() const OVERRIDE; |
| + virtual gfx::NativeView GetNativeView() const OVERRIDE; |
| + virtual gfx::NativeViewId GetNativeViewId() const OVERRIDE; |
| + virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE; |
| virtual void SetBackground(const SkBitmap& background) OVERRIDE; |
| + virtual gfx::Size GetPhysicalBackingSize() const OVERRIDE; |
| #if defined(OS_WIN) && !defined(USE_AURA) |
| virtual void SetClickthroughRegion(SkRegion* region) OVERRIDE; |
| #endif |
| @@ -76,7 +66,6 @@ class CONTENT_EXPORT RenderWidgetHostViewGuest |
| virtual void MovePluginWindows( |
| const gfx::Vector2d& scroll_offset, |
| const std::vector<WebPluginGeometry>& moves) OVERRIDE; |
| - virtual void Focus() OVERRIDE; |
| virtual void Blur() OVERRIDE; |
| virtual void UpdateCursor(const WebCursor& cursor) OVERRIDE; |
| virtual void SetIsLoading(bool is_loading) OVERRIDE; |
| @@ -97,7 +86,6 @@ class CONTENT_EXPORT RenderWidgetHostViewGuest |
| virtual void RenderProcessGone(base::TerminationStatus status, |
| int error_code) OVERRIDE; |
| virtual void Destroy() OVERRIDE; |
| - virtual void WillDestroyRenderWidget(RenderWidgetHost* rwh) {} |
| virtual void SetTooltipText(const base::string16& tooltip_text) OVERRIDE; |
| virtual void SelectionChanged(const base::string16& text, |
| size_t offset, |
| @@ -124,18 +112,19 @@ class CONTENT_EXPORT RenderWidgetHostViewGuest |
| virtual void AcceleratedSurfacePostSubBuffer( |
| const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, |
| int gpu_host_id) OVERRIDE; |
| - virtual void OnSwapCompositorFrame( |
| - uint32 output_surface_id, |
| - scoped_ptr<cc::CompositorFrame> frame) OVERRIDE; |
| virtual void AcceleratedSurfaceSuspend() OVERRIDE; |
| virtual void AcceleratedSurfaceRelease() OVERRIDE; |
| virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE; |
| + virtual void OnSwapCompositorFrame( |
| + uint32 output_surface_id, |
| + scoped_ptr<cc::CompositorFrame> frame) OVERRIDE; |
| + virtual void GetScreenInfo(blink::WebScreenInfo* results) OVERRIDE; |
| + virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE; |
| + virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE; |
| virtual void SetHasHorizontalScrollbar( |
| bool has_horizontal_scrollbar) OVERRIDE; |
| virtual void SetScrollOffsetPinning( |
| bool is_pinned_to_left, bool is_pinned_to_right) OVERRIDE; |
| - virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE; |
| - virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE; |
| #if defined(OS_WIN) || defined(USE_AURA) |
| virtual void ProcessAckedTouchEvent( |
| const TouchEventWithLatencyInfo& touch, |
| @@ -143,7 +132,6 @@ class CONTENT_EXPORT RenderWidgetHostViewGuest |
| #endif // defined(OS_WIN) || defined(USE_AURA) |
| virtual bool LockMouse() OVERRIDE; |
| virtual void UnlockMouse() OVERRIDE; |
| - virtual void GetScreenInfo(blink::WebScreenInfo* results) OVERRIDE; |
| #if defined(OS_MACOSX) |
| // RenderWidgetHostView implementation. |
| @@ -164,8 +152,9 @@ class CONTENT_EXPORT RenderWidgetHostViewGuest |
| #if defined(OS_ANDROID) |
| // RenderWidgetHostViewPort implementation. |
| - virtual void ShowDisambiguationPopup(const gfx::Rect& target_rect, |
| - const SkBitmap& zoomed_bitmap) OVERRIDE; |
| + virtual void ShowDisambiguationPopup( |
| + const gfx::Rect& target_rect, |
| + const SkBitmap& zoomed_bitmap) OVERRIDE; |
| virtual void HasTouchEventHandlers(bool need_touch_events) OVERRIDE; |
| #endif // defined(OS_ANDROID) |
| @@ -184,39 +173,23 @@ class CONTENT_EXPORT RenderWidgetHostViewGuest |
| virtual gfx::NativeViewId GetParentForWindowlessPlugin() const OVERRIDE; |
| #endif |
| - // Overridden from ui::GestureEventHelper. |
| - virtual bool CanDispatchToConsumer(ui::GestureConsumer* consumer) OVERRIDE; |
| - virtual void DispatchPostponedGestureEvent(ui::GestureEvent* event) OVERRIDE; |
| - virtual void DispatchCancelTouchEvent(ui::TouchEvent* event) OVERRIDE; |
| - |
| protected: |
| friend class RenderWidgetHostView; |
| - private: |
| - // Destroys this view without calling |Destroy| on |platform_view_|. |
| - void DestroyGuestView(); |
| - |
| - // Builds and forwards a WebKitGestureEvent to the renderer. |
| - bool ForwardGestureEventToRenderer(ui::GestureEvent* gesture); |
| - |
| - // Process all of the given gestures (passes them on to renderer) |
| - void ProcessGestures(ui::GestureRecognizer::Gestures* gestures); |
| - |
| + // Members will become private when RenderWidgetHostViewGuest is removed. |
| // The model object. |
| RenderWidgetHostImpl* host_; |
| - BrowserPluginGuest *guest_; |
| + // frame_connector_ provides a platform abstraction. Messages |
| + // sent through it are routed to the embedding renderer process. |
| + CrossProcessFrameConnector* frame_connector_; |
| + |
| gfx::Size size_; |
| - // The platform view for this RenderWidgetHostView. |
| - // RenderWidgetHostViewGuest mostly only cares about stuff related to |
| - // compositing, the rest are directly forwared to this |platform_view_|. |
| - RenderWidgetHostViewPort* platform_view_; |
| -#if defined(OS_WIN) || defined(USE_AURA) |
| - scoped_ptr<ui::GestureRecognizer> gesture_recognizer_; |
| -#endif // defined(OS_WIN) || defined(USE_AURA) |
| - DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewGuest); |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewChildFrame); |
| }; |
| } // namespace content |
| -#endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_ |
| +#endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ |