Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / ui / touch_selection / touch_handle_drawable_aura.h
blobcb9dc9cd7561d7dee1a8acf335fe32845d877acb
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.
5 #ifndef UI_TOUCH_SELECTION_TOUCH_HANDLE_DRAWABLE_AURA_H_
6 #define UI_TOUCH_SELECTION_TOUCH_HANDLE_DRAWABLE_AURA_H_
8 #include "ui/touch_selection/touch_handle.h"
9 #include "ui/touch_selection/touch_handle_orientation.h"
10 #include "ui/touch_selection/ui_touch_selection_export.h"
12 namespace aura {
13 class Window;
16 namespace aura_extra {
17 class ImageWindowDelegate;
20 namespace ui {
22 class UI_TOUCH_SELECTION_EXPORT TouchHandleDrawableAura
23 : public TouchHandleDrawable {
24 public:
25 explicit TouchHandleDrawableAura(aura::Window* parent);
26 ~TouchHandleDrawableAura() override;
28 private:
29 void UpdateBounds();
31 bool IsVisible() const;
33 // TouchHandleDrawable:
34 void SetEnabled(bool enabled) override;
35 void SetOrientation(TouchHandleOrientation orientation) override;
36 void SetAlpha(float alpha) override;
37 void SetFocus(const gfx::PointF& position) override;
38 gfx::RectF GetVisibleBounds() const override;
40 aura_extra::ImageWindowDelegate* window_delegate_;
41 scoped_ptr<aura::Window> window_;
42 bool enabled_;
43 float alpha_;
44 ui::TouchHandleOrientation orientation_;
46 // Focal position of the handle set via SetFocus (normally located on the
47 // intersection of the cursor line and the text base line), in coordinate
48 // space of selection controller client (i.e. handle's parent).
49 gfx::PointF focal_position_;
51 // Window bounds relative to the focal position.
52 gfx::RectF relative_bounds_;
54 DISALLOW_COPY_AND_ASSIGN(TouchHandleDrawableAura);
57 } // namespace ui
59 #endif // UI_TOUCH_SELECTION_TOUCH_HANDLE_DRAWABLE_AURA_H_