OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CONTENT_BROWSER_ANDROID_COMPOSITED_TOUCH_HANDLE_DRAWABLE_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_COMPOSITED_TOUCH_HANDLE_DRAWABLE_H_ |
6 #define CONTENT_BROWSER_ANDROID_COMPOSITED_TOUCH_HANDLE_DRAWABLE_H_ | 6 #define CONTENT_BROWSER_ANDROID_COMPOSITED_TOUCH_HANDLE_DRAWABLE_H_ |
7 | 7 |
8 #include "ui/touch_selection/touch_handle.h" | 8 #include "ui/touch_selection/touch_handle.h" |
9 | 9 |
10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
11 #include "cc/layers/ui_resource_layer.h" | 11 #include "cc/layers/ui_resource_layer.h" |
12 | 12 |
13 namespace content { | 13 namespace content { |
14 | 14 |
15 // Touch handle drawable implementation backed by a cc layer. | 15 // Touch handle drawable implementation backed by a cc layer. |
16 class CompositedTouchHandleDrawable : public ui::TouchHandleDrawable { | 16 class CompositedTouchHandleDrawable : public ui::TouchHandleDrawable { |
17 public: | 17 public: |
18 CompositedTouchHandleDrawable(cc::Layer* root_layer, | 18 CompositedTouchHandleDrawable(cc::Layer* root_layer, |
19 float dpi_scale, | 19 float dpi_scale, |
20 jobject context); | 20 jobject context); |
21 ~CompositedTouchHandleDrawable() override; | 21 ~CompositedTouchHandleDrawable() override; |
22 | 22 |
23 // ui::TouchHandleDrawable implementation. | 23 // ui::TouchHandleDrawable implementation. |
24 void SetEnabled(bool enabled) override; | 24 void SetEnabled(bool enabled) override; |
25 void SetOrientation(ui::TouchHandleOrientation orientation) override; | 25 void SetOrientation(ui::TouchHandleOrientation orientation, |
| 26 bool mirror_vertical, |
| 27 bool mirror_horizontal) override; |
| 28 void SetOrigin(const gfx::PointF& origin) override; |
26 void SetAlpha(float alpha) override; | 29 void SetAlpha(float alpha) override; |
27 void SetFocus(const gfx::PointF& position) override; | |
28 gfx::RectF GetVisibleBounds() const override; | 30 gfx::RectF GetVisibleBounds() const override; |
| 31 float GetDrawableHorizontalPaddingRatio() const override; |
29 | 32 |
30 static bool RegisterHandleViewResources(JNIEnv* env); | 33 static bool RegisterHandleViewResources(JNIEnv* env); |
31 | 34 |
32 private: | 35 private: |
33 void DetachLayer(); | 36 void DetachLayer(); |
34 void UpdateLayerPosition(); | 37 void UpdateLayerPosition(); |
35 | 38 |
36 const float dpi_scale_; | 39 const float dpi_scale_; |
| 40 float drawable_horizontal_padding_ratio_; |
37 ui::TouchHandleOrientation orientation_; | 41 ui::TouchHandleOrientation orientation_; |
38 gfx::PointF focal_position_; | 42 gfx::PointF origin_position_; |
39 gfx::Vector2dF focal_offset_from_origin_; | |
40 scoped_refptr<cc::UIResourceLayer> layer_; | 43 scoped_refptr<cc::UIResourceLayer> layer_; |
41 | 44 |
42 DISALLOW_COPY_AND_ASSIGN(CompositedTouchHandleDrawable); | 45 DISALLOW_COPY_AND_ASSIGN(CompositedTouchHandleDrawable); |
43 }; | 46 }; |
44 | 47 |
45 } // namespace content | 48 } // namespace content |
46 | 49 |
47 #endif // CONTENT_BROWSER_ANDROID_COMPOSITED_TOUCH_HANDLE_DRAWABLE_H_ | 50 #endif // CONTENT_BROWSER_ANDROID_COMPOSITED_TOUCH_HANDLE_DRAWABLE_H_ |
OLD | NEW |