Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Unified Diff: ui/touch_selection/touch_handle_drawable_aura.h

Issue 996373002: Add Aura handles to be used in unified touch selection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review comments Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/touch_selection/DEPS ('k') | ui/touch_selection/touch_handle_drawable_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/touch_selection/touch_handle_drawable_aura.h
diff --git a/ui/touch_selection/touch_handle_drawable_aura.h b/ui/touch_selection/touch_handle_drawable_aura.h
new file mode 100644
index 0000000000000000000000000000000000000000..cb9dc9cd7561d7dee1a8acf335fe32845d877acb
--- /dev/null
+++ b/ui/touch_selection/touch_handle_drawable_aura.h
@@ -0,0 +1,59 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_TOUCH_SELECTION_TOUCH_HANDLE_DRAWABLE_AURA_H_
+#define UI_TOUCH_SELECTION_TOUCH_HANDLE_DRAWABLE_AURA_H_
+
+#include "ui/touch_selection/touch_handle.h"
+#include "ui/touch_selection/touch_handle_orientation.h"
+#include "ui/touch_selection/ui_touch_selection_export.h"
+
+namespace aura {
+class Window;
+}
+
+namespace aura_extra {
+class ImageWindowDelegate;
+}
+
+namespace ui {
+
+class UI_TOUCH_SELECTION_EXPORT TouchHandleDrawableAura
+ : public TouchHandleDrawable {
+ public:
+ explicit TouchHandleDrawableAura(aura::Window* parent);
+ ~TouchHandleDrawableAura() override;
+
+ private:
+ void UpdateBounds();
+
+ bool IsVisible() const;
+
+ // TouchHandleDrawable:
+ void SetEnabled(bool enabled) override;
+ void SetOrientation(TouchHandleOrientation orientation) override;
+ void SetAlpha(float alpha) override;
+ void SetFocus(const gfx::PointF& position) override;
+ gfx::RectF GetVisibleBounds() const override;
+
+ aura_extra::ImageWindowDelegate* window_delegate_;
+ scoped_ptr<aura::Window> window_;
+ bool enabled_;
+ float alpha_;
+ ui::TouchHandleOrientation orientation_;
+
+ // Focal position of the handle set via SetFocus (normally located on the
+ // intersection of the cursor line and the text base line), in coordinate
+ // space of selection controller client (i.e. handle's parent).
+ gfx::PointF focal_position_;
+
+ // Window bounds relative to the focal position.
+ gfx::RectF relative_bounds_;
+
+ DISALLOW_COPY_AND_ASSIGN(TouchHandleDrawableAura);
+};
+
+} // namespace ui
+
+#endif // UI_TOUCH_SELECTION_TOUCH_HANDLE_DRAWABLE_AURA_H_
« no previous file with comments | « ui/touch_selection/DEPS ('k') | ui/touch_selection/touch_handle_drawable_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698