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 aura_extra::ImageWindowDelegate { | |
sadrul
2015/03/05 12:37:03
Instead of making TouchHandleDrawableAura a subcla
mohsen
2015/03/06 23:10:08
Yeah. Done.
| |
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 protected: | |
24 // aura_extra::ImageWindowDelegate: | |
25 void OnWindowDestroyed(aura::Window* window) override; | |
26 | |
27 private: | |
28 void UpdateBounds(); | |
29 | |
30 // TouchHandleDrawable: | |
31 void SetEnabled(bool enabled) override; | |
32 void SetOrientation(TouchHandleOrientation orientation) override; | |
33 void SetAlpha(float alpha) override; | |
34 void SetFocus(const gfx::PointF& position) override; | |
35 gfx::RectF GetVisibleBounds() const override; | |
36 | |
37 scoped_ptr<aura::Window> window_; | |
38 bool enabled_; | |
39 float alpha_; | |
40 TouchHandleOrientation orientation_; | |
41 | |
42 // Focal position of the handle set via SetFocus (normally located on the | |
43 // intersection of the cursor line and the text base line). | |
44 gfx::PointF focal_position_; | |
45 | |
46 // Window bounds relative to the focal position. | |
47 gfx::RectF relative_bounds_; | |
48 | |
49 DISALLOW_COPY_AND_ASSIGN(TouchHandleDrawableAura); | |
50 }; | |
51 | |
52 } // namespace ui | |
53 | |
54 #endif // UI_TOUCH_SELECTION_TOUCH_HANDLE_DRAWABLE_AURA_H_ | |
OLD | NEW |