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

Unified Diff: ui/touch_selection/touch_selection_controller_android.h

Issue 1046783002: wip: Aura-specific implementation of unified touch selection: touch_selection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moving the responsibility for showing the menu into the client. Created 5 years, 8 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
Index: ui/touch_selection/touch_selection_controller_android.h
diff --git a/ui/touch_selection/touch_selection_controller_android.h b/ui/touch_selection/touch_selection_controller_android.h
new file mode 100644
index 0000000000000000000000000000000000000000..b53143e5dbebb63d0694830581bafa701254d84f
--- /dev/null
+++ b/ui/touch_selection/touch_selection_controller_android.h
@@ -0,0 +1,52 @@
+// 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_SELECTION_CONTROLLER_ANDROID_H_
+#define UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_ANDROID_H_
+
+#include "ui/gfx/geometry/point_f.h"
+#include "ui/touch_selection/selection_event_type.h"
+#include "ui/touch_selection/touch_selection_controller.h"
+
+namespace ui {
+
+// Interface through which |TouchSelectionControllerAndroid| issues
+// selection-related commands, notifications and requests.
+class UI_TOUCH_SELECTION_EXPORT TouchSelectionControllerAndroidClient
+ : public TouchSelectionControllerClient {
+ public:
+ ~TouchSelectionControllerAndroidClient() override {}
+
+ virtual bool SupportsAnimation() const = 0;
+ virtual void SetNeedsAnimate() = 0;
+ virtual void OnSelectionEvent(SelectionEventType event,
+ const gfx::PointF& position) = 0;
+ virtual scoped_ptr<TouchHandleDrawable> CreateDrawable() = 0;
+};
+
+// Android implementation of |TouchSelectionController|.
+class UI_TOUCH_SELECTION_EXPORT TouchSelectionControllerAndroid
+ : public TouchSelectionController {
+ public:
+ TouchSelectionControllerAndroid(TouchSelectionControllerAndroidClient* client,
+ base::TimeDelta tap_timeout,
+ float tap_slop);
+ ~TouchSelectionControllerAndroid() override;
+
+ private:
+ // TouchSelectionController:
+ void OnSelectionEvent(SelectionEventType event,
+ const gfx::PointF& position) override;
+ bool SupportsAnimation() const override;
+ void SetNeedsAnimate() override;
+ scoped_ptr<TouchHandleDrawable> CreateDrawable() override;
+
+ TouchSelectionControllerAndroidClient* const client_;
+
+ DISALLOW_COPY_AND_ASSIGN(TouchSelectionControllerAndroid);
+};
+
+} // namespace ui
+
+#endif // UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_ANDROID_H_
« no previous file with comments | « ui/touch_selection/touch_selection_controller.cc ('k') | ui/touch_selection/touch_selection_controller_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698