| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_RENDERER_INPUT_FRAME_INPUT_HIT_TEST_IMPL_H_ |
| 6 #define CONTENT_RENDERER_INPUT_FRAME_INPUT_HIT_TEST_IMPL_H_ |
| 7 |
| 8 #include "base/memory/ref_counted.h" |
| 9 #include "content/renderer/render_frame_impl.h" |
| 10 #include "mojo/public/cpp/bindings/binding.h" |
| 11 #include "services/viz/public/interfaces/hit_test/input_hit_test.mojom.h" |
| 12 |
| 13 namespace content { |
| 14 class MainThreadEventQueue; |
| 15 |
| 16 // This class provides an implementation of FrameInputHitTest mojo interface. |
| 17 class FrameInputHitTestImpl : public viz::mojom::FrameInputHitTest { |
| 18 public: |
| 19 static void CreateMojoService(base::WeakPtr<RenderFrameImpl> render_frame, |
| 20 viz::mojom::FrameInputHitTestRequest request); |
| 21 |
| 22 void HitTestFrameAt(const gfx::Point& point, |
| 23 HitTestFrameAtCallback callback) override; |
| 24 |
| 25 private: |
| 26 ~FrameInputHitTestImpl() override; |
| 27 |
| 28 FrameInputHitTestImpl(base::WeakPtr<RenderFrameImpl> render_frame, |
| 29 viz::mojom::FrameInputHitTestRequest request); |
| 30 |
| 31 void RunOnMainThread(base::OnceClosure closure); |
| 32 void HitTestOnMainThread(const gfx::Point&, HitTestFrameAtCallback); |
| 33 |
| 34 void BindNow(viz::mojom::FrameInputHitTestRequest request); |
| 35 void Release(); |
| 36 |
| 37 mojo::Binding<viz::mojom::FrameInputHitTest> binding_; |
| 38 |
| 39 // |render_frame_| should only be accessed on the main thread. Use |
| 40 // GetRenderFrame so that it will DCHECK this for you. |
| 41 base::WeakPtr<RenderFrameImpl> render_frame_; |
| 42 |
| 43 scoped_refptr<MainThreadEventQueue> input_event_queue_; |
| 44 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
| 45 |
| 46 base::WeakPtr<FrameInputHitTestImpl> weak_this_; |
| 47 base::WeakPtrFactory<FrameInputHitTestImpl> weak_ptr_factory_; |
| 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(FrameInputHitTestImpl); |
| 50 }; |
| 51 |
| 52 } // namespace content |
| 53 |
| 54 #endif // CONTENT_RENDERER_INPUT_FRAME_INPUT_HIT_TEST_IMPL_H_ |
| OLD | NEW |