| Index: content/browser/renderer_host/render_widget_host_view_cast.h
|
| diff --git a/content/browser/frame_host/render_widget_host_view_child_frame.h b/content/browser/renderer_host/render_widget_host_view_cast.h
|
| similarity index 56%
|
| copy from content/browser/frame_host/render_widget_host_view_child_frame.h
|
| copy to content/browser/renderer_host/render_widget_host_view_cast.h
|
| index 279bafc21a6e9a5864356ad8f42d82b89e92d710..a8b08a65ce6261346fd0c276b12d2c8820ce7b0b 100644
|
| --- a/content/browser/frame_host/render_widget_host_view_child_frame.h
|
| +++ b/content/browser/renderer_host/render_widget_host_view_cast.h
|
| @@ -2,56 +2,45 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_
|
| -#define CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_
|
| +#ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_CAST_H_
|
| +#define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_CAST_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/gfx/native_widget_types.h"
|
| #include "ui/gfx/rect.h"
|
|
|
| +struct AccessibilityHostMsg_EventParams;
|
| +
|
| +namespace gfx {
|
| +namespace chromecast {
|
| +class Surface;
|
| +} // namespace chromecast
|
| +} // namespace gfx
|
| +
|
| namespace content {
|
| -class CrossProcessFrameConnector;
|
| -class RenderWidgetHost;
|
| class RenderWidgetHostImpl;
|
|
|
| -// 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.
|
| -//
|
| +//-----------------------------------------------------------------------------
|
| // See comments in render_widget_host_view.h about this class and its members.
|
| -class CONTENT_EXPORT RenderWidgetHostViewChildFrame
|
| - : public RenderWidgetHostViewBase {
|
| +// -----------------------------------------------------------------------------
|
| +class RenderWidgetHostViewCast : public RenderWidgetHostViewBase {
|
| public:
|
| - explicit RenderWidgetHostViewChildFrame(RenderWidgetHost* widget);
|
| - virtual ~RenderWidgetHostViewChildFrame();
|
| -
|
| - void set_cross_process_frame_connector(
|
| - CrossProcessFrameConnector* frame_connector) {
|
| - frame_connector_ = frame_connector;
|
| - }
|
| + virtual ~RenderWidgetHostViewCast();
|
|
|
| // RenderWidgetHostView implementation.
|
| 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 void Focus() OVERRIDE;
|
| + virtual gfx::NativeView GetNativeView() const OVERRIDE;
|
| + virtual gfx::NativeViewId GetNativeViewId() const OVERRIDE;
|
| + virtual gfx::NativeViewAccessible GetNativeViewAccessible() 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;
|
|
|
| // RenderWidgetHostViewPort implementation.
|
| virtual void InitAsPopup(RenderWidgetHostView* parent_host_view,
|
| @@ -63,18 +52,14 @@ class CONTENT_EXPORT RenderWidgetHostViewChildFrame
|
| 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;
|
| virtual void TextInputTypeChanged(ui::TextInputType type,
|
| - ui::TextInputMode input_mode,
|
| + ui::TextInputMode mode,
|
| bool can_compose_inline) OVERRIDE;
|
| virtual void ImeCancelComposition() OVERRIDE;
|
| -#if defined(OS_MACOSX) || defined(USE_AURA)
|
| - virtual void ImeCompositionRangeChanged(
|
| - const gfx::Range& range,
|
| - const std::vector<gfx::Rect>& character_bounds) OVERRIDE;
|
| -#endif
|
| virtual void DidUpdateBackingStore(
|
| const gfx::Rect& scroll_rect,
|
| const gfx::Vector2d& scroll_delta,
|
| @@ -84,18 +69,12 @@ class CONTENT_EXPORT RenderWidgetHostViewChildFrame
|
| int error_code) OVERRIDE;
|
| virtual void Destroy() OVERRIDE;
|
| virtual void SetTooltipText(const base::string16& tooltip_text) OVERRIDE;
|
| - virtual void SelectionChanged(const base::string16& text,
|
| - size_t offset,
|
| - const gfx::Range& range) OVERRIDE;
|
| virtual void SelectionBoundsChanged(
|
| const ViewHostMsg_SelectionBounds_Params& params) OVERRIDE;
|
| -#if defined(OS_ANDROID)
|
| - virtual void SelectionRootBoundsChanged(const gfx::Rect& bounds) OVERRIDE;
|
| -#endif
|
| virtual void ScrollOffsetChanged() OVERRIDE;
|
| virtual void CopyFromCompositingSurface(
|
| - const gfx::Rect& src_subrect,
|
| - const gfx::Size& dst_size,
|
| + const gfx::Rect& subrect,
|
| + const gfx::Size& size,
|
| const base::Callback<void(bool, const SkBitmap&)>& callback,
|
| const SkBitmap::Config config) OVERRIDE;
|
| virtual void CopyFromCompositingSurfaceToVideoFrame(
|
| @@ -103,9 +82,9 @@ class CONTENT_EXPORT RenderWidgetHostViewChildFrame
|
| const scoped_refptr<media::VideoFrame>& target,
|
| const base::Callback<void(bool)>& callback) OVERRIDE;
|
| virtual bool CanCopyToVideoFrame() const OVERRIDE;
|
| - virtual void OnAcceleratedCompositingStateChange() OVERRIDE;
|
| virtual void AcceleratedSurfaceInitialized(int host_id,
|
| int route_id) OVERRIDE;
|
| + virtual void OnAcceleratedCompositingStateChange() OVERRIDE;
|
| virtual void AcceleratedSurfaceBuffersSwapped(
|
| const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params,
|
| int gpu_host_id) OVERRIDE;
|
| @@ -115,71 +94,54 @@ class CONTENT_EXPORT RenderWidgetHostViewChildFrame
|
| 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;
|
| -#if defined(USE_AURA)
|
| - virtual void ProcessAckedTouchEvent(
|
| - const TouchEventWithLatencyInfo& touch,
|
| - InputEventAckState ack_result) OVERRIDE;
|
| -#endif // defined(USE_AURA)
|
| + virtual void GetScreenInfo(blink::WebScreenInfo* results) OVERRIDE;
|
| + virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE;
|
| + virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE;
|
| virtual bool LockMouse() OVERRIDE;
|
| virtual void UnlockMouse() OVERRIDE;
|
| + virtual void OnSwapCompositorFrame(
|
| + uint32 output_surface_id,
|
| + scoped_ptr<cc::CompositorFrame> frame) OVERRIDE;
|
|
|
| -#if defined(OS_MACOSX)
|
| - // RenderWidgetHostView implementation.
|
| - virtual void SetActive(bool active) OVERRIDE;
|
| - virtual void SetTakesFocusOnlyOnMouseDown(bool flag) OVERRIDE;
|
| - virtual void SetWindowVisibility(bool visible) OVERRIDE;
|
| - virtual void WindowFrameChanged() OVERRIDE;
|
| - virtual void ShowDefinitionForSelection() OVERRIDE;
|
| - virtual bool SupportsSpeech() const OVERRIDE;
|
| - virtual void SpeakSelection() OVERRIDE;
|
| - virtual bool IsSpeaking() const OVERRIDE;
|
| - virtual void StopSpeaking() OVERRIDE;
|
| + protected:
|
| + friend class RenderWidgetHostView;
|
|
|
| - // RenderWidgetHostViewPort implementation.
|
| - virtual bool PostProcessEventForPluginIme(
|
| - const NativeWebKeyboardEvent& event) OVERRIDE;
|
| -#endif // defined(OS_MACOSX)
|
| + // Should construct only via RenderWidgetHostView::CreateViewForWidget.
|
| + explicit RenderWidgetHostViewCast(RenderWidgetHost* widget);
|
|
|
| -#if defined(OS_ANDROID)
|
| - // RenderWidgetHostViewPort implementation.
|
| - virtual void ShowDisambiguationPopup(
|
| - const gfx::Rect& target_rect,
|
| - const SkBitmap& zoomed_bitmap) OVERRIDE;
|
| -#endif // defined(OS_ANDROID)
|
| + private:
|
| + // The model object.
|
| + RenderWidgetHostImpl* host_;
|
|
|
| -#if defined(OS_WIN)
|
| - virtual void SetParentNativeViewAccessible(
|
| - gfx::NativeViewAccessible accessible_parent) OVERRIDE;
|
| - virtual gfx::NativeViewId GetParentForWindowlessPlugin() const OVERRIDE;
|
| -#endif
|
| + // This is true when we are currently painting and thus should handle extra
|
| + // paint requests by expanding the invalid rect rather than actually
|
| + // painting.
|
| + bool about_to_validate_and_paint_;
|
|
|
| - virtual SkBitmap::Config PreferredReadbackFormat() OVERRIDE;
|
| + // This is the rectangle which we'll paint.
|
| + gfx::Rect invalid_rect_;
|
|
|
| - protected:
|
| - friend class RenderWidgetHostView;
|
| + // Whether or not this widget is hidden.
|
| + bool is_hidden_;
|
|
|
| - // Members will become private when RenderWidgetHostViewGuest is removed.
|
| - // The model object.
|
| - RenderWidgetHostImpl* host_;
|
| + // Whether we are currently loading.
|
| + bool is_loading_;
|
|
|
| - // frame_connector_ provides a platform abstraction. Messages
|
| - // sent through it are routed to the embedding renderer process.
|
| - CrossProcessFrameConnector* frame_connector_;
|
| + // Is the widget fullscreen?
|
| + bool is_fullscreen_;
|
|
|
| - private:
|
| - DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewChildFrame);
|
| -};
|
| + // The size that we want the renderer to be.
|
| + gfx::Size requested_size_;
|
|
|
| + std::vector<ui::LatencyInfo> software_latency_info_;
|
| +
|
| + scoped_ptr<gfx::chromecast::Surface> surface_;
|
| + void Paint(const gfx::Rect&);
|
| +};
|
| } // namespace content
|
|
|
| -#endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_
|
| +#endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_CAST_H_
|
|
|