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