| 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 |
| 11 namespace ui { |
| 12 |
| 13 class TouchHandleDrawableAura : public TouchHandleDrawable, |
| 14 public aura_extra::ImageWindowDelegate { |
| 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 protected: |
| 23 // aura_extra::ImageWindowDelegate: |
| 24 void OnWindowDestroyed(aura::Window* window) override; |
| 25 |
| 26 private: |
| 27 void UpdateBounds(); |
| 28 |
| 29 // TouchHandleDrawable: |
| 30 void SetEnabled(bool enabled) override; |
| 31 void SetOrientation(TouchHandleOrientation orientation) override; |
| 32 void SetAlpha(float alpha) override; |
| 33 void SetFocus(const gfx::PointF& position) override; |
| 34 gfx::RectF GetVisibleBounds() const override; |
| 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 |