mirror of
				https://bitbucket.org/chromiumembedded/cef
				synced 2025-06-05 21:39:12 +02:00 
			
		
		
		
	
		
			
				
	
	
		
			95 lines
		
	
	
		
			3.6 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			95 lines
		
	
	
		
			3.6 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
| diff --git components/input/fling_scheduler_base.h components/input/fling_scheduler_base.h
 | |
| index 76057b3e50f78..d3b63a3b07805 100644
 | |
| --- components/input/fling_scheduler_base.h
 | |
| +++ components/input/fling_scheduler_base.h
 | |
| @@ -5,14 +5,26 @@
 | |
|  #ifndef COMPONENTS_INPUT_FLING_SCHEDULER_BASE_H_
 | |
|  #define COMPONENTS_INPUT_FLING_SCHEDULER_BASE_H_
 | |
|  
 | |
| +#include "base/memory/raw_ptr.h"
 | |
|  #include "components/input/fling_controller.h"
 | |
|  
 | |
| +namespace ui {
 | |
| +class Compositor;
 | |
| +}
 | |
| +
 | |
|  namespace input {
 | |
|  
 | |
|  class FlingSchedulerBase : public FlingControllerSchedulerClient {
 | |
|   public:
 | |
|    virtual void ProgressFlingOnBeginFrameIfneeded(
 | |
|        base::TimeTicks current_time) = 0;
 | |
| +  
 | |
| +  void SetCompositor(ui::Compositor* compositor) {
 | |
| +    compositor_ = compositor;
 | |
| +  }
 | |
| +
 | |
| + protected:
 | |
| +  raw_ptr<ui::Compositor> compositor_ = nullptr;
 | |
|  };
 | |
|  
 | |
|  }  // namespace input
 | |
| diff --git components/input/render_input_router.h components/input/render_input_router.h
 | |
| index 469148c58889e..ec78b8abc9c05 100644
 | |
| --- components/input/render_input_router.h
 | |
| +++ components/input/render_input_router.h
 | |
| @@ -68,6 +68,7 @@ class COMPONENT_EXPORT(INPUT) RenderInputRouter
 | |
|  
 | |
|    InputRouter* input_router() { return input_router_.get(); }
 | |
|    RenderInputRouterDelegate* delegate() { return delegate_; }
 | |
| +  input::FlingSchedulerBase* fling_scheduler() { return fling_scheduler_.get(); }
 | |
|  
 | |
|    void SetForceEnableZoom(bool);
 | |
|    void SetDeviceScaleFactor(float device_scale_factor);
 | |
| diff --git content/browser/renderer_host/input/fling_scheduler.cc content/browser/renderer_host/input/fling_scheduler.cc
 | |
| index f1030a744809c..c222a209949e6 100644
 | |
| --- content/browser/renderer_host/input/fling_scheduler.cc
 | |
| +++ content/browser/renderer_host/input/fling_scheduler.cc
 | |
| @@ -98,6 +98,9 @@ void FlingScheduler::ProgressFlingOnBeginFrameIfneeded(
 | |
|  }
 | |
|  
 | |
|  ui::Compositor* FlingScheduler::GetCompositor() {
 | |
| +  if (compositor_) {
 | |
| +    return compositor_;
 | |
| +  }
 | |
|    if (!host_->GetView()) {
 | |
|      return nullptr;
 | |
|    }
 | |
| diff --git content/browser/renderer_host/render_widget_host_impl.cc content/browser/renderer_host/render_widget_host_impl.cc
 | |
| index 3b450b572c3ef..a1b4835cc10f5 100644
 | |
| --- content/browser/renderer_host/render_widget_host_impl.cc
 | |
| +++ content/browser/renderer_host/render_widget_host_impl.cc
 | |
| @@ -820,7 +820,7 @@ void RenderWidgetHostImpl::WasHidden() {
 | |
|  
 | |
|    // Cancel pending pointer lock requests, unless there's an open user prompt.
 | |
|    // Prompts should remain open and functional across tab switches.
 | |
| -  if (!delegate_->IsWaitingForPointerLockPrompt(this)) {
 | |
| +  if (!delegate_ || !delegate_->IsWaitingForPointerLockPrompt(this)) {
 | |
|      RejectPointerLockOrUnlockIfNecessary(
 | |
|          blink::mojom::PointerLockResult::kWrongDocument);
 | |
|    }
 | |
| @@ -3293,6 +3293,11 @@ void RenderWidgetHostImpl::DecrementInFlightEventCount(
 | |
|    }
 | |
|  }
 | |
|  
 | |
| +void RenderWidgetHostImpl::SetCompositorForFlingScheduler(
 | |
| +    ui::Compositor* compositor) {
 | |
| +  GetRenderInputRouter()->fling_scheduler()->SetCompositor(compositor);
 | |
| +}
 | |
| +
 | |
|  void RenderWidgetHostImpl::AddPendingUserActivation(
 | |
|      const WebInputEvent& event) {
 | |
|    if ((base::FeatureList::IsEnabled(
 | |
| diff --git content/browser/renderer_host/render_widget_host_impl.h content/browser/renderer_host/render_widget_host_impl.h
 | |
| index 82d6357c3006b..48cf3141004ff 100644
 | |
| --- content/browser/renderer_host/render_widget_host_impl.h
 | |
| +++ content/browser/renderer_host/render_widget_host_impl.h
 | |
| @@ -847,6 +847,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl
 | |
|  
 | |
|    void ProgressFlingIfNeeded(base::TimeTicks current_time);
 | |
|    void StopFling();
 | |
| +  void SetCompositorForFlingScheduler(ui::Compositor* compositor);
 | |
|  
 | |
|    RenderWidgetHostViewBase* GetRenderWidgetHostViewBase();
 | |
|  
 |