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