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

Unified Diff: ui/touch_selection/touch_selection_controller_aura.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: Refactoring - common client for Aura and Android. Created 5 years, 9 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_aura.h
diff --git a/ui/touch_selection/touch_selection_controller_aura.h b/ui/touch_selection/touch_selection_controller_aura.h
new file mode 100644
index 0000000000000000000000000000000000000000..546e2c85d9ed553da2886fd75535d8eb006539e3
--- /dev/null
+++ b/ui/touch_selection/touch_selection_controller_aura.h
@@ -0,0 +1,76 @@
+// 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_AURA_H_
+#define UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_AURA_H_
+
+#include "base/timer/timer.h"
+#include "ui/events/event_handler.h"
+#include "ui/events/event_target.h"
+#include "ui/touch_selection/touch_selection_controller_impl.h"
+
+namespace aura {
+class Window;
+}
+
+namespace ui {
+class MotionEventAura;
+class TouchEvent;
+class TouchSelectionControllerAuraTestApi;
+
+// Aura implementation of |TouchSelectionController|.
+class UI_TOUCH_SELECTION_EXPORT TouchSelectionControllerAura
+ : public TouchSelectionControllerImpl,
+ public EventHandler {
+ public:
+ TouchSelectionControllerAura(
+ TouchSelectionControllerClient* client,
+ base::TimeDelta tap_timeout,
+ float tap_slop,
+ bool show_on_tap_for_empty_editable);
+
+ ~TouchSelectionControllerAura() override;
+
+ // TouchSelectionController:
+ bool OnSelectionBoundsUpdated(const SelectionBound& start,
+ const SelectionBound& end) override;
+ bool WillHandleTouchEvent(const MotionEvent& event) override;
+ void OnTapEvent() override;
+ void OnLongPressEvent() override;
+ void AllowShowingFromCurrentSelection() override;
+ void HideAndDisallowShowingAutomatically() override;
+ void SetTemporarilyHidden(bool hidden) override;
+ void OnSelectionEditable(bool editable) override;
+ void OnSelectionEmpty(bool empty) override;
+ bool Animate(base::TimeTicks animate_time) override;
+ void OnNativeViewMoved() override;
+ void OnOverscrollStarted() override;
+ void OnOverscrollCompleted() override;
+ void OnFlingCompleted() override;
+
+ private:
+ friend class TouchSelectionControllerAuraTestApi;
+ class EnvPreTargetHandler;
+
+ // TouchSelectionControllerImpl:
+ void ActivateInsertion();
+ void DeactivateInsertion();
+ void ActivateSelection();
+ void DeactivateSelection();
+
+ // EventHandler:
+ void OnTouchEvent(TouchEvent* event) override;
+ void OnGestureEvent(GestureEvent* event) override;
+
+ scoped_ptr<MotionEventAura> motion_event_;
+ scoped_ptr<EnvPreTargetHandler> env_pre_target_handler_;
+
+ TouchSelectionControllerAuraTestApi* test_api_;
+
+ DISALLOW_COPY_AND_ASSIGN(TouchSelectionControllerAura);
+};
+
+} // namespace ui
+
+#endif // UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_AURA_H_

Powered by Google App Engine
This is Rietveld 408576698