Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_EXO_POINTER_H_ | 5 #ifndef COMPONENTS_EXO_POINTER_H_ |
| 6 #define COMPONENTS_EXO_POINTER_H_ | 6 #define COMPONENTS_EXO_POINTER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 69 void OnSurfaceDestroying(Surface* surface) override; | 69 void OnSurfaceDestroying(Surface* surface) override; |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 // Returns the effective target for |event|. | 72 // Returns the effective target for |event|. |
| 73 Surface* GetEffectiveTargetForEvent(ui::Event* event) const; | 73 Surface* GetEffectiveTargetForEvent(ui::Event* event) const; |
| 74 | 74 |
| 75 // Asynchronously update the cursor by capturing a snapshot of |surface_|. | 75 // Asynchronously update the cursor by capturing a snapshot of |surface_|. |
| 76 void CaptureCursor(); | 76 void CaptureCursor(); |
| 77 | 77 |
| 78 // Called when cursor snapshot has been captured. | 78 // Called when cursor snapshot has been captured. |
| 79 void OnCursorCaptured(const gfx::Point& hotspot, | 79 void OnCursorCaptured(gfx::Point hotspot, |
| 80 std::unique_ptr<cc::CopyOutputResult> result); | 80 std::unique_ptr<cc::CopyOutputResult> result); |
| 81 | 81 |
| 82 void UpdateCursor(gfx::NativeCursor cursor); | 82 void UpdateCursor(gfx::NativeCursor cursor); |
| 83 | 83 |
| 84 // The delegate instance that all events are dispatched to. | 84 // The delegate instance that all events are dispatched to. |
| 85 PointerDelegate* const delegate_; | 85 PointerDelegate* const delegate_; |
| 86 | 86 |
| 87 // The current pointer surface. | 87 // The current pointer surface. |
| 88 Surface* surface_ = nullptr; | 88 Surface* surface_ = nullptr; |
| 89 | 89 |
| 90 // The current focus surface for the pointer. | 90 // The current focus surface for the pointer. |
| 91 Surface* focus_ = nullptr; | 91 Surface* focus_ = nullptr; |
| 92 | 92 |
| 93 // The location of the pointer in the current focus surface. | 93 // The location of the pointer in the current focus surface. |
| 94 gfx::PointF location_; | 94 gfx::PointF location_; |
| 95 | 95 |
| 96 // The display-dependent scale applied to the cursor. | 96 // The display-dependent scale applied to the cursor. |
| 97 float display_scale_ = 1.0f; | 97 float display_scale_ = 1.0f; |
| 98 | 98 |
| 99 // The display-independent scale applied to the cursor. | 99 // The display-independent scale applied to the cursor. |
| 100 float cursor_scale_ = 1.0f; | 100 float cursor_scale_ = 1.0f; |
| 101 | 101 |
| 102 // Device scale factor of the display where the mouse is located. | 102 // Device scale factor of the display where the mouse is located. |
| 103 float device_scale_factor_ = 1.0f; | 103 float device_scale_factor_ = 1.0f; |
| 104 display::Display::Rotation rotation_ = display::Display::ROTATE_0; | |
|
reveman
2017/04/28 21:27:42
nit: please give this a blank line and short comme
Dominik Laskowski
2017/05/06 00:37:16
Done.
| |
| 104 | 105 |
| 105 // The position of the pointer surface relative to the pointer location. | 106 // The position of the pointer surface relative to the pointer location. |
| 106 gfx::Point hotspot_; | 107 gfx::Point hotspot_; |
| 107 | 108 |
| 108 const std::unique_ptr<aura::Window> cursor_; | 109 const std::unique_ptr<aura::Window> cursor_; |
| 109 | 110 |
| 110 // Source used for cursor capture copy output requests. | 111 // Source used for cursor capture copy output requests. |
| 111 const base::UnguessableToken cursor_capture_source_id_; | 112 const base::UnguessableToken cursor_capture_source_id_; |
| 112 | 113 |
| 113 // Weak pointer factory used for cursor capture callbacks. | 114 // Weak pointer factory used for cursor capture callbacks. |
| 114 base::WeakPtrFactory<Pointer> cursor_capture_weak_ptr_factory_; | 115 base::WeakPtrFactory<Pointer> cursor_capture_weak_ptr_factory_; |
| 115 | 116 |
| 116 DISALLOW_COPY_AND_ASSIGN(Pointer); | 117 DISALLOW_COPY_AND_ASSIGN(Pointer); |
| 117 }; | 118 }; |
| 118 | 119 |
| 119 } // namespace exo | 120 } // namespace exo |
| 120 | 121 |
| 121 #endif // COMPONENTS_EXO_POINTER_H_ | 122 #endif // COMPONENTS_EXO_POINTER_H_ |
| OLD | NEW |