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

Side by Side Diff: content/browser/renderer_host/input/touch_selection_controller_client_aura.h

Issue 698253004: Reland: Implement Aura side of unified touch text selection for contents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Improved a comment Created 5 years, 5 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 unified diff | Download patch
OLDNEW
(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 CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_SELECTION_CONTROLLER_CLIENT_AU RA_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_SELECTION_CONTROLLER_CLIENT_AU RA_H_
7
8 #include "base/timer/timer.h"
9 #include "ui/touch_selection/touch_selection_controller.h"
10 #include "ui/touch_selection/touch_selection_menu_runner.h"
11
12 namespace content {
13 class RenderWidgetHostViewAura;
14
15 // An implementation of |TouchSelectionControllerClient| to be used in Aura's
16 // implementation of touch selection for contents.
17 class TouchSelectionControllerClientAura
18 : public ui::TouchSelectionControllerClient,
19 public ui::TouchSelectionMenuClient {
20 public:
21 explicit TouchSelectionControllerClientAura(RenderWidgetHostViewAura* rwhva);
22 ~TouchSelectionControllerClientAura() override;
23
24 void OnWindowMoved();
sadrul 2015/07/15 17:00:15 Document of this is called only for the RWHVA's wi
mohsen 2015/07/16 22:06:19 Done.
25 void OnTouchDown();
26 void OnTouchUp();
sadrul 2015/07/15 17:00:15 Document if this happens for all touch up/down eve
mohsen 2015/07/16 22:06:19 Done.
27 void OnScrollStarted();
28 void OnScrollCompleted();
sadrul 2015/07/15 17:00:15 Document if this is called just for touch-scroll,
mohsen 2015/07/16 22:06:19 Done.
29
30 private:
31 class EnvPreTargetHandler;
32
33 bool IsQuickMenuAllowed() const;
34 void ShowQuickMenu();
35 void UpdateQuickMenu();
36
37 // ui::TouchSelectionControllerClient:
38 bool SupportsAnimation() const override;
39 void SetNeedsAnimate() override;
40 void MoveCaret(const gfx::PointF& position) override;
41 void MoveRangeSelectionExtent(const gfx::PointF& extent) override;
42 void SelectBetweenCoordinates(const gfx::PointF& base,
43 const gfx::PointF& extent) override;
44 void OnSelectionEvent(ui::SelectionEventType event) override;
45 scoped_ptr<ui::TouchHandleDrawable> CreateDrawable() override;
46
47 // ui::TouchSelectionMenuClient:
48 bool IsCommandIdEnabled(int command_id) const override;
49 void ExecuteCommand(int command_id, int event_flags) override;
50 void RunContextMenu() override;
51
52 // Not owned, non-null for the lifetime of this object.
53 RenderWidgetHostViewAura* rwhva_;
54
55 base::Timer quick_menu_timer_;
56 bool touch_down_;
57 bool scroll_in_progress_;
58 bool handle_drag_in_progress_;
59
60 // A pre-target event handler for aura::Env which deactivates touch selection
61 // on mouse and keyboard events.
62 scoped_ptr<EnvPreTargetHandler> env_pre_target_handler_;
63
64 DISALLOW_COPY_AND_ASSIGN(TouchSelectionControllerClientAura);
65 };
66
67 } // namespace content
68
69 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_SELECTION_CONTROLLER_CLIENT _AURA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698