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

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

Issue 2883653002: Implement TouchSelectionEditing controls for OOPIF. (Closed)
Patch Set: Rebase to master@{#474649}. Created 3 years, 6 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_RENDERER_HOST_INPUT_TOUCH_SELECTION_CONTROLLER_CLIENT_CH ILD_FRAME_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_SELECTION_CONTROLLER_CLIENT_CH ILD_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. This class serves
20 // cross-process iframes, which have different renderers than the main frame,
21 // and thus have their own RenderWidgetHostViewChildFrames. Since a
22 // TouchSelectionControllerClient is intended to bind these views to the
23 // TouchSelectionController, we need a different implementation for
24 // cross-process subframes.
25 class CONTENT_EXPORT TouchSelectionControllerClientChildFrame
26 : public ui::TouchSelectionControllerClient,
27 public ui::TouchSelectionMenuClient {
28 public:
29 TouchSelectionControllerClientChildFrame(
30 RenderWidgetHostViewChildFrame* rwhv,
31 TouchSelectionControllerClientManager* manager);
32 ~TouchSelectionControllerClientChildFrame() override;
33
34 void UpdateSelectionBoundsIfNeeded(
35 const cc::Selection<gfx::SelectionBound>& selection,
36 float device_scale_factor);
37
38 private:
39 // ui::TouchSelectionControllerClient:
40 bool SupportsAnimation() const override;
41 void SetNeedsAnimate() override;
42 void MoveCaret(const gfx::PointF& position) override;
43 void MoveRangeSelectionExtent(const gfx::PointF& extent) override;
44 void SelectBetweenCoordinates(const gfx::PointF& base,
45 const gfx::PointF& extent) override;
46 void OnSelectionEvent(ui::SelectionEventType event) override;
47 std::unique_ptr<ui::TouchHandleDrawable> CreateDrawable() override;
48
49 // ui::TouchSelectionMenuClient:
50 bool IsCommandIdEnabled(int command_id) const override;
51 void ExecuteCommand(int command_id, int event_flags) override;
52 void RunContextMenu() override;
53
54 gfx::Point ConvertFromRoot(const gfx::PointF& point) const;
55
56 // Not owned, non-null for the lifetime of this object.
57 RenderWidgetHostViewChildFrame* rwhv_;
58 TouchSelectionControllerClientManager* manager_;
59
60 // The last selection bounds reported by the view.
61 gfx::SelectionBound selection_start_;
62 gfx::SelectionBound selection_end_;
63
64 DISALLOW_COPY_AND_ASSIGN(TouchSelectionControllerClientChildFrame);
65 };
66
67 } // namespace content
68 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_SELECTION_CONTROLLER_CLIENT _CHILD_FRAME_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698