| 
									
										
										
										
											2016-07-30 21:35:14 +02:00
										 |  |  | // Copyright (c) 2016 GitHub, Inc.
 | 
					
						
							| 
									
										
										
										
											2016-07-05 21:33:22 +02:00
										 |  |  | // Use of this source code is governed by the MIT license that can be
 | 
					
						
							|  |  |  | // found in the LICENSE file.
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-03 11:01:35 +09:00
										 |  |  | #ifndef ATOM_BROWSER_OSR_OSR_RENDER_WIDGET_HOST_VIEW_H_
 | 
					
						
							|  |  |  | #define ATOM_BROWSER_OSR_OSR_RENDER_WIDGET_HOST_VIEW_H_
 | 
					
						
							| 
									
										
										
										
											2016-07-05 21:33:22 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-05 16:18:57 +01:00
										 |  |  | #include <set>
 | 
					
						
							| 
									
										
										
										
											2016-07-31 12:19:56 +02:00
										 |  |  | #include <string>
 | 
					
						
							|  |  |  | #include <vector>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-03 11:01:35 +09:00
										 |  |  | #if defined(OS_WIN)
 | 
					
						
							|  |  |  | #include <windows.h>
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2016-07-27 14:36:22 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-03 11:01:35 +09:00
										 |  |  | #include "atom/browser/native_window.h"
 | 
					
						
							| 
									
										
										
										
											2016-09-16 20:43:07 +02:00
										 |  |  | #include "atom/browser/native_window_observer.h"
 | 
					
						
							| 
									
										
										
										
											2016-08-03 11:01:35 +09:00
										 |  |  | #include "atom/browser/osr/osr_output_device.h"
 | 
					
						
							| 
									
										
										
										
											2017-05-21 19:55:19 +02:00
										 |  |  | #include "atom/browser/osr/osr_view_proxy.h"
 | 
					
						
							| 
									
										
										
										
											2016-07-30 00:51:19 +02:00
										 |  |  | #include "base/process/kill.h"
 | 
					
						
							| 
									
										
										
										
											2016-07-05 21:33:22 +02:00
										 |  |  | #include "base/threading/thread.h"
 | 
					
						
							| 
									
										
										
										
											2016-07-25 15:55:00 +02:00
										 |  |  | #include "base/time/time.h"
 | 
					
						
							| 
									
										
										
										
											2017-12-05 00:35:35 +03:00
										 |  |  | #include "components/viz/common/frame_sinks/begin_frame_args.h"
 | 
					
						
							| 
									
										
										
										
											2017-12-05 00:34:15 +03:00
										 |  |  | #include "components/viz/common/frame_sinks/begin_frame_source.h"
 | 
					
						
							| 
									
										
										
										
											2017-12-18 12:40:36 +03:00
										 |  |  | #include "components/viz/common/quads/compositor_frame.h"
 | 
					
						
							| 
									
										
										
										
											2018-05-10 17:58:17 +03:00
										 |  |  | #include "components/viz/common/surfaces/parent_local_surface_id_allocator.h"
 | 
					
						
							| 
									
										
										
										
											2017-03-04 03:09:16 +01:00
										 |  |  | #include "content/browser/frame_host/render_widget_host_view_guest.h"
 | 
					
						
							| 
									
										
										
										
											2017-06-17 00:38:35 +03:00
										 |  |  | #include "content/browser/renderer_host/compositor_resize_lock.h"
 | 
					
						
							| 
									
										
										
										
											2016-08-03 11:01:35 +09:00
										 |  |  | #include "content/browser/renderer_host/delegated_frame_host.h"
 | 
					
						
							| 
									
										
										
										
											2018-08-20 18:54:31 +02:00
										 |  |  | #include "content/browser/renderer_host/input/mouse_wheel_phase_handler.h"
 | 
					
						
							| 
									
										
										
										
											2016-08-03 11:01:35 +09:00
										 |  |  | #include "content/browser/renderer_host/render_widget_host_impl.h"
 | 
					
						
							|  |  |  | #include "content/browser/renderer_host/render_widget_host_view_base.h"
 | 
					
						
							| 
									
										
										
										
											2017-03-14 12:56:24 +01:00
										 |  |  | #include "content/browser/web_contents/web_contents_view.h"
 | 
					
						
							| 
									
										
										
										
											2016-08-26 15:30:02 -07:00
										 |  |  | #include "third_party/WebKit/public/platform/WebVector.h"
 | 
					
						
							| 
									
										
										
										
											2018-04-17 21:44:10 -04:00
										 |  |  | #include "third_party/skia/include/core/SkBitmap.h"
 | 
					
						
							| 
									
										
										
										
											2016-08-26 15:30:02 -07:00
										 |  |  | #include "ui/base/ime/text_input_client.h"
 | 
					
						
							| 
									
										
										
										
											2016-07-05 21:33:22 +02:00
										 |  |  | #include "ui/compositor/compositor.h"
 | 
					
						
							|  |  |  | #include "ui/compositor/layer_delegate.h"
 | 
					
						
							|  |  |  | #include "ui/compositor/layer_owner.h"
 | 
					
						
							| 
									
										
										
										
											2016-08-03 11:01:35 +09:00
										 |  |  | #include "ui/gfx/geometry/point.h"
 | 
					
						
							| 
									
										
										
										
											2016-07-05 21:33:22 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-18 16:16:23 +02:00
										 |  |  | #if defined(OS_WIN)
 | 
					
						
							| 
									
										
										
										
											2016-07-05 21:33:22 +02:00
										 |  |  | #include "ui/gfx/win/window_impl.h"
 | 
					
						
							| 
									
										
										
										
											2016-07-18 16:16:23 +02:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #if defined(OS_MACOSX)
 | 
					
						
							|  |  |  | #include "content/browser/renderer_host/browser_compositor_view_mac.h"
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #if defined(OS_MACOSX)
 | 
					
						
							|  |  |  | #ifdef __OBJC__
 | 
					
						
							|  |  |  | @class CALayer; | 
					
						
							|  |  |  | @class NSWindow; | 
					
						
							|  |  |  | #else
 | 
					
						
							|  |  |  | class CALayer; | 
					
						
							|  |  |  | class NSWindow; | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-05 21:33:22 +02:00
										 |  |  | namespace atom { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-27 20:31:03 +02:00
										 |  |  | class AtomCopyFrameGenerator; | 
					
						
							|  |  |  | class AtomBeginFrameTimer; | 
					
						
							| 
									
										
										
										
											2016-07-18 16:16:23 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-05 14:13:34 +02:00
										 |  |  | #if defined(OS_MACOSX)
 | 
					
						
							| 
									
										
										
										
											2016-09-06 17:24:37 +09:00
										 |  |  | class MacHelper; | 
					
						
							| 
									
										
										
										
											2016-08-05 14:13:34 +02:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2016-09-06 17:24:37 +09:00
										 |  |  | 
 | 
					
						
							|  |  |  | class OffScreenRenderWidgetHostView | 
					
						
							|  |  |  |     : public content::RenderWidgetHostViewBase, | 
					
						
							| 
									
										
										
										
											2016-08-03 13:46:34 +09:00
										 |  |  |       public ui::CompositorDelegate, | 
					
						
							| 
									
										
										
										
											2016-11-30 16:30:03 +09:00
										 |  |  | #if !defined(OS_MACOSX)
 | 
					
						
							| 
									
										
										
										
											2016-09-16 20:43:07 +02:00
										 |  |  |       public content::DelegatedFrameHostClient, | 
					
						
							| 
									
										
										
										
											2017-07-09 20:53:00 +02:00
										 |  |  |       public content::CompositorResizeLockClient, | 
					
						
							| 
									
										
										
										
											2016-11-30 16:30:03 +09:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2017-05-21 19:55:19 +02:00
										 |  |  |       public NativeWindowObserver, | 
					
						
							|  |  |  |       public OffscreenViewProxyObserver { | 
					
						
							| 
									
										
										
										
											2016-07-31 12:19:56 +02:00
										 |  |  |  public: | 
					
						
							| 
									
										
										
										
											2016-08-03 13:46:34 +09:00
										 |  |  |   OffScreenRenderWidgetHostView(bool transparent, | 
					
						
							| 
									
										
										
										
											2018-01-25 14:46:30 +01:00
										 |  |  |                                 bool painting, | 
					
						
							|  |  |  |                                 int frame_rate, | 
					
						
							| 
									
										
										
										
											2016-08-04 13:03:24 +09:00
										 |  |  |                                 const OnPaintCallback& callback, | 
					
						
							| 
									
										
										
										
											2016-08-03 13:46:34 +09:00
										 |  |  |                                 content::RenderWidgetHost* render_widget_host, | 
					
						
							| 
									
										
										
										
											2017-03-04 03:09:16 +01:00
										 |  |  |                                 OffScreenRenderWidgetHostView* parent_host_view, | 
					
						
							| 
									
										
										
										
											2016-08-03 13:46:34 +09:00
										 |  |  |                                 NativeWindow* native_window); | 
					
						
							|  |  |  |   ~OffScreenRenderWidgetHostView() override; | 
					
						
							| 
									
										
										
										
											2016-07-05 21:33:22 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-03 13:46:34 +09:00
										 |  |  |   // content::RenderWidgetHostView:
 | 
					
						
							| 
									
										
										
										
											2016-07-31 12:19:56 +02:00
										 |  |  |   void InitAsChild(gfx::NativeView) override; | 
					
						
							| 
									
										
										
										
											2018-04-17 21:44:10 -04:00
										 |  |  |   void SetSize(const gfx::Size&) override; | 
					
						
							|  |  |  |   void SetBounds(const gfx::Rect&) override; | 
					
						
							| 
									
										
										
										
											2016-07-31 12:19:56 +02:00
										 |  |  |   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; | 
					
						
							| 
									
										
										
										
											2016-08-01 13:27:39 +02:00
										 |  |  |   void SetBackgroundColor(SkColor color) override; | 
					
						
							| 
									
										
										
										
											2017-07-08 21:25:15 +02:00
										 |  |  |   SkColor background_color() const override; | 
					
						
							| 
									
										
										
										
											2016-07-31 12:19:56 +02:00
										 |  |  |   bool LockMouse(void) override; | 
					
						
							|  |  |  |   void UnlockMouse(void) override; | 
					
						
							| 
									
										
										
										
											2016-11-30 16:30:03 +09:00
										 |  |  |   void SetNeedsBeginFrames(bool needs_begin_frames) override; | 
					
						
							| 
									
										
										
										
											2018-05-15 03:59:22 +02:00
										 |  |  |   void SetWantsAnimateOnlyBeginFrames() override; | 
					
						
							| 
									
										
										
										
											2016-07-31 12:19:56 +02:00
										 |  |  | #if defined(OS_MACOSX)
 | 
					
						
							|  |  |  |   void SetActive(bool active) override; | 
					
						
							|  |  |  |   void ShowDefinitionForSelection() override; | 
					
						
							|  |  |  |   bool SupportsSpeech() const override; | 
					
						
							|  |  |  |   void SpeakSelection() override; | 
					
						
							|  |  |  |   bool IsSpeaking() const override; | 
					
						
							| 
									
										
										
										
											2018-08-20 18:54:31 +02:00
										 |  |  |   bool ShouldContinueToPauseForFrame() override; | 
					
						
							| 
									
										
										
										
											2016-07-31 12:19:56 +02:00
										 |  |  |   void StopSpeaking() override; | 
					
						
							|  |  |  | #endif  // defined(OS_MACOSX)
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-03 13:46:34 +09:00
										 |  |  |   // content::RenderWidgetHostViewBase:
 | 
					
						
							| 
									
										
										
										
											2017-07-08 21:25:15 +02:00
										 |  |  |   void DidCreateNewRendererCompositorFrameSink( | 
					
						
							| 
									
										
										
										
											2017-12-05 00:35:12 +03:00
										 |  |  |       viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink) | 
					
						
							| 
									
										
										
										
											2017-07-08 21:25:15 +02:00
										 |  |  |       override; | 
					
						
							| 
									
										
										
										
											2018-05-15 03:59:22 +02:00
										 |  |  |   void SubmitCompositorFrame( | 
					
						
							|  |  |  |       const viz::LocalSurfaceId& local_surface_id, | 
					
						
							|  |  |  |       viz::CompositorFrame frame, | 
					
						
							|  |  |  |       viz::mojom::HitTestRegionListPtr hit_test_region_list) override; | 
					
						
							| 
									
										
										
										
											2017-07-08 21:25:15 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-31 12:19:56 +02:00
										 |  |  |   void ClearCompositorFrame(void) override; | 
					
						
							| 
									
										
										
										
											2018-04-17 21:44:10 -04:00
										 |  |  |   void InitAsPopup(content::RenderWidgetHostView* rwhv, | 
					
						
							|  |  |  |                    const gfx::Rect& rect) override; | 
					
						
							|  |  |  |   void InitAsFullscreen(content::RenderWidgetHostView*) override; | 
					
						
							|  |  |  |   void UpdateCursor(const content::WebCursor&) override; | 
					
						
							| 
									
										
										
										
											2016-07-31 12:19:56 +02:00
										 |  |  |   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; | 
					
						
							| 
									
										
										
										
											2018-04-17 21:44:10 -04:00
										 |  |  |   void SetTooltipText(const base::string16&) override; | 
					
						
							|  |  |  |   void SelectionBoundsChanged( | 
					
						
							|  |  |  |       const ViewHostMsg_SelectionBounds_Params&) override; | 
					
						
							| 
									
										
										
										
											2018-05-15 03:59:22 +02:00
										 |  |  |   void CopyFromSurface( | 
					
						
							|  |  |  |       const gfx::Rect& src_rect, | 
					
						
							|  |  |  |       const gfx::Size& output_size, | 
					
						
							|  |  |  |       base::OnceCallback<void(const SkBitmap&)> callback) override; | 
					
						
							|  |  |  |   void GetScreenInfo(content::ScreenInfo* results) const override; | 
					
						
							| 
									
										
										
										
											2018-04-17 21:44:10 -04:00
										 |  |  |   void InitAsGuest(content::RenderWidgetHostView*, | 
					
						
							|  |  |  |                    content::RenderWidgetHostViewGuest*) override; | 
					
						
							| 
									
										
										
										
											2018-05-15 03:59:22 +02:00
										 |  |  |   gfx::Vector2d GetOffsetFromRootSurface() override; | 
					
						
							| 
									
										
										
										
											2016-07-31 12:19:56 +02:00
										 |  |  |   gfx::Rect GetBoundsInRootWindow(void) override; | 
					
						
							| 
									
										
										
										
											2018-05-15 03:59:22 +02:00
										 |  |  |   content::RenderWidgetHostImpl* GetRenderWidgetHostImpl() const override; | 
					
						
							|  |  |  |   viz::SurfaceId GetCurrentSurfaceId() const override; | 
					
						
							| 
									
										
										
										
											2018-04-17 21:44:10 -04:00
										 |  |  |   void ImeCompositionRangeChanged(const gfx::Range&, | 
					
						
							|  |  |  |                                   const std::vector<gfx::Rect>&) override; | 
					
						
							| 
									
										
										
										
											2018-05-15 03:59:22 +02:00
										 |  |  |   gfx::Size GetCompositorViewportPixelSize() const override; | 
					
						
							| 
									
										
										
										
											2016-07-13 17:43:00 +02:00
										 |  |  |   gfx::Size GetRequestedRendererSize() const override; | 
					
						
							| 
									
										
										
										
											2016-07-05 21:33:22 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-14 12:56:24 +01:00
										 |  |  |   content::RenderWidgetHostViewBase* CreateViewForWidget( | 
					
						
							| 
									
										
										
										
											2018-04-17 21:44:10 -04:00
										 |  |  |       content::RenderWidgetHost*, | 
					
						
							|  |  |  |       content::RenderWidgetHost*, | 
					
						
							|  |  |  |       content::WebContentsView*) override; | 
					
						
							| 
									
										
										
										
											2017-03-14 12:56:24 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-30 16:30:03 +09:00
										 |  |  | #if !defined(OS_MACOSX)
 | 
					
						
							| 
									
										
										
										
											2016-08-03 13:46:34 +09:00
										 |  |  |   // content::DelegatedFrameHostClient:
 | 
					
						
							| 
									
										
										
										
											2016-07-05 21:33:22 +02:00
										 |  |  |   int DelegatedFrameHostGetGpuMemoryBufferClientId(void) const; | 
					
						
							| 
									
										
										
										
											2018-04-17 21:44:10 -04:00
										 |  |  |   ui::Layer* DelegatedFrameHostGetLayer(void) const override; | 
					
						
							| 
									
										
										
										
											2016-07-18 16:16:23 +02:00
										 |  |  |   bool DelegatedFrameHostIsVisible(void) const override; | 
					
						
							| 
									
										
										
										
											2018-05-15 03:59:22 +02:00
										 |  |  |   SkColor DelegatedFrameHostGetGutterColor() const override; | 
					
						
							| 
									
										
										
										
											2017-07-09 20:53:00 +02:00
										 |  |  |   bool DelegatedFrameCanCreateResizeLock() const override; | 
					
						
							|  |  |  |   std::unique_ptr<content::CompositorResizeLock> | 
					
						
							|  |  |  |   DelegatedFrameHostCreateResizeLock() override; | 
					
						
							| 
									
										
										
										
											2018-05-15 03:59:22 +02:00
										 |  |  |   void OnFirstSurfaceActivation(const viz::SurfaceInfo& surface_info) override; | 
					
						
							|  |  |  |   void OnBeginFrame(base::TimeTicks frame_time) override; | 
					
						
							|  |  |  |   void OnFrameTokenChanged(uint32_t frame_token) override; | 
					
						
							|  |  |  |   void DidReceiveFirstFrameAfterNavigation() override; | 
					
						
							| 
									
										
										
										
											2017-07-09 20:53:00 +02:00
										 |  |  |   // CompositorResizeLockClient implementation.
 | 
					
						
							|  |  |  |   std::unique_ptr<ui::CompositorLock> GetCompositorLock( | 
					
						
							|  |  |  |       ui::CompositorLockClient* client) override; | 
					
						
							|  |  |  |   void CompositorResizeLockEnded() override; | 
					
						
							| 
									
										
										
										
											2018-05-16 12:12:45 -07:00
										 |  |  |   bool IsAutoResizeEnabled() const override; | 
					
						
							| 
									
										
										
										
											2016-11-30 16:30:03 +09:00
										 |  |  | #endif  // !defined(OS_MACOSX)
 | 
					
						
							| 
									
										
										
										
											2016-07-26 16:52:43 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-20 18:54:31 +02:00
										 |  |  |   viz::LocalSurfaceId GetLocalSurfaceId() const override; | 
					
						
							|  |  |  |   viz::FrameSinkId GetFrameSinkId() override; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   void DidNavigate() override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-15 03:59:22 +02:00
										 |  |  |   bool TransformPointToLocalCoordSpace(const gfx::PointF& point, | 
					
						
							| 
									
										
										
										
											2018-04-17 21:44:10 -04:00
										 |  |  |                                        const viz::SurfaceId& original_surface, | 
					
						
							| 
									
										
										
										
											2018-05-15 03:59:22 +02:00
										 |  |  |                                        gfx::PointF* transformed_point) override; | 
					
						
							| 
									
										
										
										
											2017-04-05 17:31:22 +09:00
										 |  |  |   bool TransformPointToCoordSpaceForView( | 
					
						
							| 
									
										
										
										
											2018-05-15 03:59:22 +02:00
										 |  |  |       const gfx::PointF& point, | 
					
						
							| 
									
										
										
										
											2017-04-05 17:31:22 +09:00
										 |  |  |       RenderWidgetHostViewBase* target_view, | 
					
						
							| 
									
										
										
										
											2018-05-15 03:59:22 +02:00
										 |  |  |       gfx::PointF* transformed_point) override; | 
					
						
							| 
									
										
										
										
											2017-04-05 17:31:22 +09:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-03 13:46:34 +09:00
										 |  |  |   // ui::CompositorDelegate:
 | 
					
						
							| 
									
										
										
										
											2017-12-18 12:31:54 +03:00
										 |  |  |   std::unique_ptr<viz::SoftwareOutputDevice> CreateSoftwareOutputDevice( | 
					
						
							| 
									
										
										
										
											2016-07-27 18:24:58 +02:00
										 |  |  |       ui::Compositor* compositor) override; | 
					
						
							| 
									
										
										
										
											2016-08-03 13:46:34 +09:00
										 |  |  | 
 | 
					
						
							|  |  |  |   bool InstallTransparency(); | 
					
						
							| 
									
										
										
										
											2016-07-18 16:16:23 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-16 20:43:07 +02:00
										 |  |  |   // NativeWindowObserver:
 | 
					
						
							|  |  |  |   void OnWindowResize() override; | 
					
						
							| 
									
										
										
										
											2016-09-19 16:51:03 +09:00
										 |  |  |   void OnWindowClosed() override; | 
					
						
							| 
									
										
										
										
											2016-09-16 20:43:07 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-18 16:16:23 +02:00
										 |  |  |   void OnBeginFrameTimerTick(); | 
					
						
							| 
									
										
										
										
											2018-04-17 21:44:10 -04:00
										 |  |  |   void SendBeginFrame(base::TimeTicks frame_time, base::TimeDelta vsync_period); | 
					
						
							| 
									
										
										
										
											2016-07-18 16:16:23 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-03 13:46:34 +09:00
										 |  |  | #if defined(OS_MACOSX)
 | 
					
						
							| 
									
										
										
										
											2017-04-05 17:31:22 +09:00
										 |  |  |   void CreatePlatformWidget(bool is_guest_view_hack); | 
					
						
							| 
									
										
										
										
											2016-07-30 15:40:16 +02:00
										 |  |  |   void DestroyPlatformWidget(); | 
					
						
							| 
									
										
										
										
											2018-08-20 18:54:31 +02:00
										 |  |  |   SkColor last_frame_root_background_color() const { | 
					
						
							|  |  |  |     return last_frame_root_background_color_; | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2016-08-03 13:46:34 +09:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2016-07-30 15:40:16 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-04 03:09:16 +01:00
										 |  |  |   void CancelWidget(); | 
					
						
							|  |  |  |   void AddGuestHostView(OffScreenRenderWidgetHostView* guest_host); | 
					
						
							|  |  |  |   void RemoveGuestHostView(OffScreenRenderWidgetHostView* guest_host); | 
					
						
							| 
									
										
										
										
											2017-05-21 19:55:19 +02:00
										 |  |  |   void AddViewProxy(OffscreenViewProxy* proxy); | 
					
						
							|  |  |  |   void RemoveViewProxy(OffscreenViewProxy* proxy); | 
					
						
							| 
									
										
										
										
											2018-05-03 23:45:12 -07:00
										 |  |  |   void ProxyViewDestroyed(OffscreenViewProxy* proxy) override; | 
					
						
							| 
									
										
										
										
											2017-03-04 03:09:16 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   void RegisterGuestViewFrameSwappedCallback( | 
					
						
							|  |  |  |       content::RenderWidgetHostViewGuest* guest_host_view); | 
					
						
							|  |  |  |   void OnGuestViewFrameSwapped( | 
					
						
							|  |  |  |       content::RenderWidgetHostViewGuest* guest_host_view); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-04 13:22:19 +09:00
										 |  |  |   void OnPaint(const gfx::Rect& damage_rect, const SkBitmap& bitmap); | 
					
						
							| 
									
										
										
										
											2017-03-04 03:09:16 +01:00
										 |  |  |   void OnPopupPaint(const gfx::Rect& damage_rect, const SkBitmap& bitmap); | 
					
						
							| 
									
										
										
										
											2018-05-03 23:45:12 -07:00
										 |  |  |   void OnProxyViewPaint(const gfx::Rect& damage_rect) override; | 
					
						
							| 
									
										
										
										
											2017-03-05 16:18:57 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-17 21:44:10 -04:00
										 |  |  |   bool IsPopupWidget() const { return popup_type_ != blink::kWebPopupTypeNone; } | 
					
						
							| 
									
										
										
										
											2017-03-05 16:18:57 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-04 03:09:16 +01:00
										 |  |  |   void HoldResize(); | 
					
						
							|  |  |  |   void ReleaseResize(); | 
					
						
							|  |  |  |   void WasResized(); | 
					
						
							| 
									
										
										
										
											2017-03-05 16:18:57 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-15 03:59:22 +02:00
										 |  |  |   void SendMouseEvent(const blink::WebMouseEvent& event); | 
					
						
							|  |  |  |   void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); | 
					
						
							| 
									
										
										
										
											2016-07-27 19:44:41 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-31 12:19:56 +02:00
										 |  |  |   void SetPainting(bool painting); | 
					
						
							| 
									
										
										
										
											2016-07-30 15:40:16 +02:00
										 |  |  |   bool IsPainting() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-31 12:19:56 +02:00
										 |  |  |   void SetFrameRate(int frame_rate); | 
					
						
							| 
									
										
										
										
											2016-07-30 15:40:16 +02:00
										 |  |  |   int GetFrameRate() const; | 
					
						
							| 
									
										
										
										
											2016-08-03 13:46:34 +09:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-07 17:33:09 +09:00
										 |  |  |   ui::Compositor* GetCompositor() const; | 
					
						
							|  |  |  |   ui::Layer* GetRootLayer() const; | 
					
						
							|  |  |  |   content::DelegatedFrameHost* GetDelegatedFrameHost() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-01 19:25:12 +02:00
										 |  |  |   void Invalidate(); | 
					
						
							| 
									
										
										
										
											2017-03-04 03:09:16 +01:00
										 |  |  |   void InvalidateBounds(const gfx::Rect&); | 
					
						
							| 
									
										
										
										
											2016-09-01 19:25:12 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-17 21:44:10 -04:00
										 |  |  |   content::RenderWidgetHostImpl* render_widget_host() const { | 
					
						
							|  |  |  |     return render_widget_host_; | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2016-09-06 17:24:37 +09:00
										 |  |  |   NativeWindow* window() const { return native_window_; } | 
					
						
							| 
									
										
										
										
											2016-12-19 17:23:41 -08:00
										 |  |  |   gfx::Size size() const { return size_; } | 
					
						
							|  |  |  |   float scale_factor() const { return scale_factor_; } | 
					
						
							| 
									
										
										
										
											2016-08-03 13:46:34 +09:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-04 03:09:16 +01:00
										 |  |  |   void set_popup_host_view(OffScreenRenderWidgetHostView* popup_view) { | 
					
						
							|  |  |  |     popup_host_view_ = popup_view; | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2017-03-05 16:18:57 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-04 03:09:16 +01:00
										 |  |  |   void set_child_host_view(OffScreenRenderWidgetHostView* child_view) { | 
					
						
							|  |  |  |     child_host_view_ = child_view; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-03 13:46:34 +09:00
										 |  |  |  private: | 
					
						
							| 
									
										
										
										
											2016-07-31 12:19:56 +02:00
										 |  |  |   void SetupFrameRate(bool force); | 
					
						
							| 
									
										
										
										
											2018-08-20 18:54:31 +02:00
										 |  |  |   void ResizeRootLayer(bool force); | 
					
						
							| 
									
										
										
										
											2016-07-22 13:55:58 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-19 21:04:21 +02:00
										 |  |  |   viz::FrameSinkId AllocateFrameSinkId(bool is_guest_view_hack); | 
					
						
							| 
									
										
										
										
											2017-04-05 17:31:22 +09:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-07-08 21:25:15 +02:00
										 |  |  |   // Applies background color without notifying the RenderWidget about
 | 
					
						
							|  |  |  |   // opaqueness changes.
 | 
					
						
							|  |  |  |   void UpdateBackgroundColorFromRenderer(SkColor color); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-03 13:46:34 +09:00
										 |  |  |   // Weak ptrs.
 | 
					
						
							| 
									
										
										
										
											2016-07-13 17:43:00 +02:00
										 |  |  |   content::RenderWidgetHostImpl* render_widget_host_; | 
					
						
							| 
									
										
										
										
											2017-03-05 16:18:57 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-22 00:18:38 +02:00
										 |  |  |   OffScreenRenderWidgetHostView* parent_host_view_ = nullptr; | 
					
						
							|  |  |  |   OffScreenRenderWidgetHostView* popup_host_view_ = nullptr; | 
					
						
							| 
									
										
										
										
											2017-03-04 03:09:16 +01:00
										 |  |  |   std::unique_ptr<SkBitmap> popup_bitmap_; | 
					
						
							| 
									
										
										
										
											2018-05-22 00:18:38 +02:00
										 |  |  |   OffScreenRenderWidgetHostView* child_host_view_ = nullptr; | 
					
						
							| 
									
										
										
										
											2017-03-04 03:09:16 +01:00
										 |  |  |   std::set<OffScreenRenderWidgetHostView*> guest_host_views_; | 
					
						
							| 
									
										
										
										
											2017-05-21 19:55:19 +02:00
										 |  |  |   std::set<OffscreenViewProxy*> proxy_views_; | 
					
						
							| 
									
										
										
										
											2017-03-05 16:18:57 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-27 14:36:22 +02:00
										 |  |  |   NativeWindow* native_window_; | 
					
						
							| 
									
										
										
										
											2018-05-22 00:18:38 +02:00
										 |  |  |   OffScreenOutputDevice* software_output_device_ = nullptr; | 
					
						
							| 
									
										
										
										
											2016-07-22 13:55:58 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-04 13:03:24 +09:00
										 |  |  |   const bool transparent_; | 
					
						
							| 
									
										
										
										
											2016-08-03 13:04:36 +09:00
										 |  |  |   OnPaintCallback callback_; | 
					
						
							| 
									
										
										
										
											2017-03-04 03:09:16 +01:00
										 |  |  |   OnPaintCallback parent_callback_; | 
					
						
							| 
									
										
										
										
											2016-07-29 14:50:27 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-22 00:18:38 +02:00
										 |  |  |   int frame_rate_ = 0; | 
					
						
							|  |  |  |   int frame_rate_threshold_us_ = 0; | 
					
						
							| 
									
										
										
										
											2016-07-05 21:33:22 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-22 00:18:38 +02:00
										 |  |  |   base::Time last_time_ = base::Time::Now(); | 
					
						
							| 
									
										
										
										
											2016-07-25 15:55:00 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-13 17:43:00 +02:00
										 |  |  |   float scale_factor_; | 
					
						
							|  |  |  |   gfx::Vector2dF last_scroll_offset_; | 
					
						
							|  |  |  |   gfx::Size size_; | 
					
						
							| 
									
										
										
										
											2016-07-30 15:40:16 +02:00
										 |  |  |   bool painting_; | 
					
						
							| 
									
										
										
										
											2017-03-05 16:18:57 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-22 00:18:38 +02:00
										 |  |  |   bool is_showing_ = false; | 
					
						
							|  |  |  |   bool is_destroyed_ = false; | 
					
						
							| 
									
										
										
										
											2017-03-04 03:09:16 +01:00
										 |  |  |   gfx::Rect popup_position_; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-22 00:18:38 +02:00
										 |  |  |   bool hold_resize_ = false; | 
					
						
							|  |  |  |   bool pending_resize_ = false; | 
					
						
							| 
									
										
										
										
											2016-07-05 21:33:22 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-22 00:18:38 +02:00
										 |  |  |   bool paint_callback_running_ = false; | 
					
						
							| 
									
										
										
										
											2018-01-25 14:42:11 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-17 23:26:41 +01:00
										 |  |  |   viz::LocalSurfaceId local_surface_id_; | 
					
						
							| 
									
										
										
										
											2018-05-10 17:58:17 +03:00
										 |  |  |   viz::ParentLocalSurfaceIdAllocator local_surface_id_allocator_; | 
					
						
							| 
									
										
										
										
											2018-03-17 23:26:41 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-18 16:16:23 +02:00
										 |  |  |   std::unique_ptr<ui::Layer> root_layer_; | 
					
						
							| 
									
										
										
										
											2016-08-03 13:46:34 +09:00
										 |  |  |   std::unique_ptr<ui::Compositor> compositor_; | 
					
						
							|  |  |  |   std::unique_ptr<content::DelegatedFrameHost> delegated_frame_host_; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   std::unique_ptr<AtomCopyFrameGenerator> copy_frame_generator_; | 
					
						
							|  |  |  |   std::unique_ptr<AtomBeginFrameTimer> begin_frame_timer_; | 
					
						
							| 
									
										
										
										
											2016-07-18 16:16:23 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-05 17:31:22 +09:00
										 |  |  |   // Provides |source_id| for BeginFrameArgs that we create.
 | 
					
						
							| 
									
										
										
										
											2017-12-05 00:34:15 +03:00
										 |  |  |   viz::StubBeginFrameSource begin_frame_source_; | 
					
						
							| 
									
										
										
										
											2017-12-05 00:35:35 +03:00
										 |  |  |   uint64_t begin_frame_number_ = viz::BeginFrameArgs::kStartingFrameNumber; | 
					
						
							| 
									
										
										
										
											2017-04-05 17:31:22 +09:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-02 12:56:03 +02:00
										 |  |  | #if defined(OS_MACOSX)
 | 
					
						
							| 
									
										
										
										
											2016-07-18 16:16:23 +02:00
										 |  |  |   std::unique_ptr<content::BrowserCompositorMac> browser_compositor_; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-20 18:54:31 +02:00
										 |  |  |   SkColor last_frame_root_background_color_; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-06 17:24:37 +09:00
										 |  |  |   // Can not be managed by smart pointer because its header can not be included
 | 
					
						
							|  |  |  |   // in the file that has the destructor.
 | 
					
						
							| 
									
										
										
										
											2016-09-07 17:33:09 +09:00
										 |  |  |   MacHelper* mac_helper_; | 
					
						
							| 
									
										
										
										
											2016-09-06 17:24:37 +09:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-18 16:16:23 +02:00
										 |  |  |   // Selected text on the renderer.
 | 
					
						
							|  |  |  |   std::string selected_text_; | 
					
						
							| 
									
										
										
										
											2016-07-13 17:43:00 +02:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2016-07-05 21:33:22 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-20 18:54:31 +02:00
										 |  |  |   content::MouseWheelPhaseHandler mouse_wheel_phase_handler_; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-22 00:18:38 +02:00
										 |  |  |   viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink_ = | 
					
						
							|  |  |  |       nullptr; | 
					
						
							| 
									
										
										
										
											2017-07-08 21:25:15 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-22 00:18:38 +02:00
										 |  |  |   SkColor background_color_ = SkColor(); | 
					
						
							| 
									
										
										
										
											2017-07-08 21:25:15 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-29 14:50:27 +02:00
										 |  |  |   base::WeakPtrFactory<OffScreenRenderWidgetHostView> weak_ptr_factory_; | 
					
						
							| 
									
										
										
										
											2016-08-03 13:46:34 +09:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-29 14:50:27 +02:00
										 |  |  |   DISALLOW_COPY_AND_ASSIGN(OffScreenRenderWidgetHostView); | 
					
						
							| 
									
										
										
										
											2016-07-05 21:33:22 +02:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | }  // namespace atom
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-03 11:01:35 +09:00
										 |  |  | #endif  // ATOM_BROWSER_OSR_OSR_RENDER_WIDGET_HOST_VIEW_H_
 |