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 UI_TOUCH_SELECTION_TOUCH_HANDLE_DRAWABLE_AURA_H_ |
| 6 #define UI_TOUCH_SELECTION_TOUCH_HANDLE_DRAWABLE_AURA_H_ |
| 7 |
| 8 #include "ui/aura/image_window_delegate.h" |
| 9 #include "ui/touch_selection/touch_handle.h" |
| 10 |
| 11 namespace ui { |
| 12 |
| 13 class TouchHandleDrawableAura : public TouchHandleDrawable, |
| 14 public aura::ImageWindowDelegate { |
| 15 public: |
| 16 // Returns the maximum width/height that can be occupied by a handle image. |
| 17 static gfx::Size GetMaxHandleImageSize(); |
| 18 |
| 19 explicit TouchHandleDrawableAura(aura::Window* parent); |
| 20 ~TouchHandleDrawableAura() override; |
| 21 |
| 22 private: |
| 23 friend class TouchSelectionControllerAuraTest; |
| 24 |
| 25 void UpdateBounds(); |
| 26 |
| 27 // TouchHandleDrawable: |
| 28 void SetEnabled(bool enabled) override; |
| 29 void SetOrientation(TouchHandleOrientation orientation) override; |
| 30 void SetAlpha(float alpha) override; |
| 31 void SetFocus(const gfx::PointF& position) override; |
| 32 gfx::RectF GetVisibleBounds() const override; |
| 33 |
| 34 aura::Window* window_for_testing() const { return window_.get(); } |
| 35 |
| 36 scoped_ptr<aura::Window> window_; |
| 37 bool enabled_; |
| 38 float alpha_; |
| 39 TouchHandleOrientation orientation_; |
| 40 |
| 41 // Focal position of the handle set via SetFocus (normally located on the |
| 42 // intersection of the cursor line and the text base line). |
| 43 gfx::PointF focal_position_; |
| 44 |
| 45 // Window bounds relative to the focal position. |
| 46 gfx::RectF relative_bounds_; |
| 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(TouchHandleDrawableAura); |
| 49 }; |
| 50 |
| 51 } // namespace ui |
| 52 |
| 53 #endif // UI_TOUCH_SELECTION_TOUCH_HANDLE_DRAWABLE_AURA_H_ |
OLD | NEW |