|
@@ -5,6 +5,9 @@
|
|
|
#ifndef ATOM_BROWSER_OSR_RENDER_WIDGET_HOST_VIEW_H_
|
|
|
#define ATOM_BROWSER_OSR_RENDER_WIDGET_HOST_VIEW_H_
|
|
|
|
|
|
+#include <string>
|
|
|
+#include <vector>
|
|
|
+
|
|
|
#include "atom/browser/native_window.h"
|
|
|
|
|
|
#include "content/browser/renderer_host/render_widget_host_view_base.h"
|
|
@@ -59,82 +62,85 @@ class OffScreenRenderWidgetHostView:
|
|
|
#endif
|
|
|
public ui::CompositorDelegate,
|
|
|
public content::DelegatedFrameHostClient {
|
|
|
-public:
|
|
|
+ public:
|
|
|
OffScreenRenderWidgetHostView(content::RenderWidgetHost*, NativeWindow*);
|
|
|
~OffScreenRenderWidgetHostView();
|
|
|
|
|
|
// content::RenderWidgetHostView
|
|
|
bool OnMessageReceived(const IPC::Message&) override;
|
|
|
- void InitAsChild(gfx::NativeView) override;
|
|
|
- content::RenderWidgetHost* GetRenderWidgetHost(void) const override;
|
|
|
- void SetSize(const gfx::Size &) override;
|
|
|
- void SetBounds(const gfx::Rect &) override;
|
|
|
- gfx::Vector2dF GetLastScrollOffset(void) const override;
|
|
|
- gfx::NativeView GetNativeView(void) const override;
|
|
|
- gfx::NativeViewAccessible GetNativeViewAccessible(void) override;
|
|
|
- ui::TextInputClient* GetTextInputClient() override;
|
|
|
- void Focus(void) override;
|
|
|
- bool HasFocus(void) const override;
|
|
|
- bool IsSurfaceAvailableForCopy(void) const override;
|
|
|
- void Show(void) override;
|
|
|
- void Hide(void) override;
|
|
|
- bool IsShowing(void) override;
|
|
|
- gfx::Rect GetViewBounds(void) const override;
|
|
|
- gfx::Size GetVisibleViewportSize() const override;
|
|
|
- void SetInsets(const gfx::Insets&) override;
|
|
|
- bool LockMouse(void) override;
|
|
|
- void UnlockMouse(void) override;
|
|
|
- bool GetScreenColorProfile(std::vector<char>*) override;
|
|
|
-
|
|
|
+ void InitAsChild(gfx::NativeView) override;
|
|
|
+ content::RenderWidgetHost* GetRenderWidgetHost(void) const override;
|
|
|
+ void SetSize(const gfx::Size &) override;
|
|
|
+ void SetBounds(const gfx::Rect &) override;
|
|
|
+ gfx::Vector2dF GetLastScrollOffset(void) const override;
|
|
|
+ gfx::NativeView GetNativeView(void) const override;
|
|
|
+ gfx::NativeViewAccessible GetNativeViewAccessible(void) override;
|
|
|
+ ui::TextInputClient* GetTextInputClient() override;
|
|
|
+ void Focus(void) override;
|
|
|
+ bool HasFocus(void) const override;
|
|
|
+ bool IsSurfaceAvailableForCopy(void) const override;
|
|
|
+ void Show(void) override;
|
|
|
+ void Hide(void) override;
|
|
|
+ bool IsShowing(void) override;
|
|
|
+ gfx::Rect GetViewBounds(void) const override;
|
|
|
+ gfx::Size GetVisibleViewportSize() const override;
|
|
|
+ void SetInsets(const gfx::Insets&) override;
|
|
|
+ bool LockMouse(void) override;
|
|
|
+ void UnlockMouse(void) override;
|
|
|
+ bool GetScreenColorProfile(std::vector<char>*) override;
|
|
|
+
|
|
|
+#if defined(OS_MACOSX)
|
|
|
+ ui::AcceleratedWidgetMac* GetAcceleratedWidgetMac() const override;
|
|
|
+ void SetActive(bool active) override;
|
|
|
+ void ShowDefinitionForSelection() override;
|
|
|
+ bool SupportsSpeech() const override;
|
|
|
+ void SpeakSelection() override;
|
|
|
+ bool IsSpeaking() const override;
|
|
|
+ void StopSpeaking() override;
|
|
|
+#endif // defined(OS_MACOSX)
|
|
|
+
|
|
|
+ // content::RenderWidgetHostViewBase
|
|
|
+ void OnSwapCompositorFrame(uint32_t, std::unique_ptr<cc::CompositorFrame>)
|
|
|
+ override;
|
|
|
+ void ClearCompositorFrame(void) override;
|
|
|
+ void InitAsPopup(content::RenderWidgetHostView *rwhv, const gfx::Rect& rect)
|
|
|
+ override;
|
|
|
+ void InitAsFullscreen(content::RenderWidgetHostView *) override;
|
|
|
+ void UpdateCursor(const content::WebCursor &) override;
|
|
|
+ void SetIsLoading(bool is_loading) override;
|
|
|
+ void TextInputStateChanged(const content::TextInputState& params) override;
|
|
|
+ void ImeCancelComposition(void) override;
|
|
|
+ void RenderProcessGone(base::TerminationStatus, int) override;
|
|
|
+ void Destroy(void) override;
|
|
|
+ void SetTooltipText(const base::string16 &) override;
|
|
|
+
|
|
|
#if defined(OS_MACOSX)
|
|
|
- ui::AcceleratedWidgetMac* GetAcceleratedWidgetMac() const override;
|
|
|
- void SetActive(bool active) override;
|
|
|
- void ShowDefinitionForSelection() override;
|
|
|
- bool SupportsSpeech() const override;
|
|
|
- void SpeakSelection() override;
|
|
|
- bool IsSpeaking() const override;
|
|
|
- void StopSpeaking() override;
|
|
|
-#endif // defined(OS_MACOSX)
|
|
|
-
|
|
|
- // content::RenderWidgetHostViewBase
|
|
|
- void OnSwapCompositorFrame(uint32_t, std::unique_ptr<cc::CompositorFrame>) override;
|
|
|
- void ClearCompositorFrame(void) override;
|
|
|
- void InitAsPopup(content::RenderWidgetHostView *, const gfx::Rect &) override;
|
|
|
- void InitAsFullscreen(content::RenderWidgetHostView *) override;
|
|
|
- void UpdateCursor(const content::WebCursor &) override;
|
|
|
- void SetIsLoading(bool) override;
|
|
|
- void TextInputStateChanged(const content::TextInputState& params) override;
|
|
|
- void ImeCancelComposition(void) override;
|
|
|
- void RenderProcessGone(base::TerminationStatus,int) override;
|
|
|
- void Destroy(void) override;
|
|
|
- void SetTooltipText(const base::string16 &) override;
|
|
|
-
|
|
|
-#if defined(OS_MACOSX)
|
|
|
- void SelectionChanged(const base::string16& text,
|
|
|
- size_t offset,
|
|
|
- const gfx::Range& range) override;
|
|
|
-#endif
|
|
|
-
|
|
|
- void SelectionBoundsChanged(const ViewHostMsg_SelectionBounds_Params &) override;
|
|
|
- void CopyFromCompositingSurface(const gfx::Rect &,
|
|
|
- const gfx::Size &,
|
|
|
- const content::ReadbackRequestCallback &,
|
|
|
- const SkColorType) override;
|
|
|
- void CopyFromCompositingSurfaceToVideoFrame(
|
|
|
- const gfx::Rect &,
|
|
|
- const scoped_refptr<media::VideoFrame> &,
|
|
|
- const base::Callback<void (const gfx::Rect &, bool),
|
|
|
- base::internal::CopyMode::Copyable> &) override;
|
|
|
- bool CanCopyToVideoFrame(void) const override;
|
|
|
- void BeginFrameSubscription(
|
|
|
- std::unique_ptr<content::RenderWidgetHostViewFrameSubscriber>) override;
|
|
|
- void EndFrameSubscription() override;
|
|
|
- bool HasAcceleratedSurface(const gfx::Size &) override;
|
|
|
- void GetScreenInfo(blink::WebScreenInfo *) override;
|
|
|
- bool GetScreenColorProfile(blink::WebVector<char>*);
|
|
|
- gfx::Rect GetBoundsInRootWindow(void) override;
|
|
|
- void LockCompositingSurface(void) override;
|
|
|
- void UnlockCompositingSurface(void) override;
|
|
|
+ void SelectionChanged(const base::string16& text,
|
|
|
+ size_t offset,
|
|
|
+ const gfx::Range& range) override;
|
|
|
+#endif
|
|
|
+
|
|
|
+ void SelectionBoundsChanged(const ViewHostMsg_SelectionBounds_Params &)
|
|
|
+ override;
|
|
|
+ void CopyFromCompositingSurface(const gfx::Rect &,
|
|
|
+ const gfx::Size &,
|
|
|
+ const content::ReadbackRequestCallback &,
|
|
|
+ const SkColorType) override;
|
|
|
+ void CopyFromCompositingSurfaceToVideoFrame(
|
|
|
+ const gfx::Rect &,
|
|
|
+ const scoped_refptr<media::VideoFrame> &,
|
|
|
+ const base::Callback<void(const gfx::Rect &, bool),
|
|
|
+ base::internal::CopyMode::Copyable> &) override;
|
|
|
+ bool CanCopyToVideoFrame(void) const override;
|
|
|
+ void BeginFrameSubscription(
|
|
|
+ std::unique_ptr<content::RenderWidgetHostViewFrameSubscriber>) override;
|
|
|
+ void EndFrameSubscription() override;
|
|
|
+ bool HasAcceleratedSurface(const gfx::Size &) override;
|
|
|
+ void GetScreenInfo(blink::WebScreenInfo *) override;
|
|
|
+ bool GetScreenColorProfile(blink::WebVector<char>*);
|
|
|
+ gfx::Rect GetBoundsInRootWindow(void) override;
|
|
|
+ void LockCompositingSurface(void) override;
|
|
|
+ void UnlockCompositingSurface(void) override;
|
|
|
void ImeCompositionRangeChanged(
|
|
|
const gfx::Range &, const std::vector<gfx::Rect>&) override;
|
|
|
gfx::Size GetPhysicalBackingSize() const override;
|
|
@@ -147,7 +153,8 @@ public:
|
|
|
SkColor DelegatedFrameHostGetGutterColor(SkColor) const override;
|
|
|
gfx::Size DelegatedFrameHostDesiredSizeInDIP(void) const override;
|
|
|
bool DelegatedFrameCanCreateResizeLock(void) const override;
|
|
|
- std::unique_ptr<content::ResizeLock> DelegatedFrameHostCreateResizeLock(bool) override;
|
|
|
+ std::unique_ptr<content::ResizeLock> DelegatedFrameHostCreateResizeLock(
|
|
|
+ bool defer_compositor_lock) override;
|
|
|
void DelegatedFrameHostResizeLockWasReleased(void) override;
|
|
|
void DelegatedFrameHostSendCompositorSwapAck(
|
|
|
int, const cc::CompositorFrameAck &) override;
|
|
@@ -190,13 +197,13 @@ public:
|
|
|
int bitmap_height,
|
|
|
void* bitmap_pixels);
|
|
|
|
|
|
- void SetPainting(bool);
|
|
|
+ void SetPainting(bool painting);
|
|
|
bool IsPainting() const;
|
|
|
|
|
|
- void SetFrameRate(int);
|
|
|
+ void SetFrameRate(int frame_rate);
|
|
|
int GetFrameRate() const;
|
|
|
private:
|
|
|
- void SetupFrameRate(bool);
|
|
|
+ void SetupFrameRate(bool force);
|
|
|
void ResizeRootLayer();
|
|
|
|
|
|
content::RenderWidgetHostImpl* render_widget_host_;
|