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

Side by Side Diff: content/browser/frame_host/touch_selection_controller_client_child_frame.h

Issue 2883653002: Implement TouchSelectionEditing controls for OOPIF. (Closed)
Patch Set: Address kenrb@'s comments. Created 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 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_FRAME_HOST_TOUCH_SELECTION_CONTROLLER_CLIENT_CHILD_FRAME _H_
6 #define CONTENT_BROWSER_FRAME_HOST_TOUCH_SELECTION_CONTROLLER_CLIENT_CHILD_FRAME _H_
7
8 #include "base/macros.h"
9 #include "cc/input/selection.h"
10 #include "content/common/content_export.h"
11 #include "ui/touch_selection/touch_selection_controller.h"
12 #include "ui/touch_selection/touch_selection_menu_runner.h"
13
14 namespace content {
15 class RenderWidgetHostViewChildFrame;
16 class TouchSelectionControllerClientManager;
17
18 // An implementation of |TouchSelectionControllerClient| to be used by
19 // implementations of TouchSelectionControllerClientManager.
20 class CONTENT_EXPORT TouchSelectionControllerClientChildFrame
21 : public ui::TouchSelectionControllerClient,
22 public ui::TouchSelectionMenuClient {
23 public:
24 TouchSelectionControllerClientChildFrame(
25 RenderWidgetHostViewChildFrame* rwhv,
26 TouchSelectionControllerClientManager* manager);
27 ~TouchSelectionControllerClientChildFrame() override;
28
29 void UpdateSelectionBoundsIfNeeded(
30 const cc::Selection<gfx::SelectionBound>& selection,
31 float device_scale_factor);
32
33 private:
34 // ui::TouchSelectionControllerClient:
35 bool SupportsAnimation() const override;
36 void SetNeedsAnimate() override;
37 void MoveCaret(const gfx::PointF& position) override;
38 void MoveRangeSelectionExtent(const gfx::PointF& extent) override;
39 void SelectBetweenCoordinates(const gfx::PointF& base,
40 const gfx::PointF& extent) override;
41 void OnSelectionEvent(ui::SelectionEventType event) override;
42 std::unique_ptr<ui::TouchHandleDrawable> CreateDrawable() override;
43
44 // ui::TouchSelectionMenuClient:
45 bool IsCommandIdEnabled(int command_id) const override;
46 void ExecuteCommand(int command_id, int event_flags) override;
47 void RunContextMenu() override;
48
49 gfx::Point ConvertFromRoot(const gfx::PointF& point) const;
50
51 // Not owned, non-null for the lifetime of this object.
52 RenderWidgetHostViewChildFrame* rwhv_;
53 TouchSelectionControllerClientManager* manager_;
54
55 // The last selection bounds reported by the view.
56 gfx::SelectionBound selection_start_;
57 gfx::SelectionBound selection_end_;
58
59 DISALLOW_COPY_AND_ASSIGN(TouchSelectionControllerClientChildFrame);
60 };
61
62 } // namespace content
63 #endif // CONTENT_BROWSER_FRAME_HOST_TOUCH_SELECTION_CONTROLLER_CLIENT_CHILD_FR AME_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698