OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_ANDROID_COMPOSITED_TOUCH_HANDLE_DRAWABLE_H_ |
| 6 #define CONTENT_BROWSER_ANDROID_COMPOSITED_TOUCH_HANDLE_DRAWABLE_H_ |
| 7 |
| 8 #include "content/browser/renderer_host/input/touch_handle.h" |
| 9 |
| 10 #include "base/android/jni_android.h" |
| 11 #include "cc/layers/ui_resource_layer.h" |
| 12 |
| 13 namespace content { |
| 14 |
| 15 // Touch handle drawable implementation backed by a cc layer. |
| 16 class CompositedTouchHandleDrawable : public TouchHandleDrawable { |
| 17 public: |
| 18 CompositedTouchHandleDrawable(cc::Layer* root_layer, float dpi_scale); |
| 19 virtual ~CompositedTouchHandleDrawable(); |
| 20 |
| 21 // TouchHandleDrawable implementation. |
| 22 virtual void SetOrientation(TouchHandleOrientation orientation) OVERRIDE; |
| 23 virtual void SetAlpha(float alpha) OVERRIDE; |
| 24 virtual void SetFocus(const gfx::PointF& position) OVERRIDE; |
| 25 virtual void SetVisible(bool visible) OVERRIDE; |
| 26 virtual bool ContainsPoint(const gfx::PointF& point) const OVERRIDE; |
| 27 |
| 28 static bool RegisterHandleViewResources(JNIEnv* env); |
| 29 |
| 30 private: |
| 31 void Detach(); |
| 32 gfx::RectF BoundingRect() const; |
| 33 |
| 34 const float dpi_scale_; |
| 35 TouchHandleOrientation orientation_; |
| 36 gfx::PointF focal_position_; |
| 37 gfx::Vector2dF focal_offset_from_origin_; |
| 38 |
| 39 scoped_refptr<cc::UIResourceLayer> layer_; |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(CompositedTouchHandleDrawable); |
| 42 }; |
| 43 |
| 44 } // namespace content |
| 45 |
| 46 #endif // CONTENT_BROWSER_ANDROID_COMPOSITED_TOUCH_HANDLE_DRAWABLE_H_ |
OLD | NEW |