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

Side by Side Diff: content/browser/renderer_host/input/ui_touch_selection_helper.cc

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: Rebased after addition of touch_handle_orientation file 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 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 #include "content/browser/renderer_host/input/ui_touch_selection_helper.h"
6
7 #include "base/logging.h"
8 #include "cc/output/viewport_selection_bound.h"
9
10 namespace content {
11
12 namespace {
13
14 ui::SelectionBound::Type ConvertSelectionBoundType(
15 cc::SelectionBoundType type) {
16 switch (type) {
17 case cc::SELECTION_BOUND_LEFT:
18 return ui::SelectionBound::LEFT;
19 case cc::SELECTION_BOUND_RIGHT:
20 return ui::SelectionBound::RIGHT;
21 case cc::SELECTION_BOUND_CENTER:
22 return ui::SelectionBound::CENTER;
23 case cc::SELECTION_BOUND_EMPTY:
24 return ui::SelectionBound::EMPTY;
25 }
26 NOTREACHED() << "Unknown selection bound type";
27 return ui::SelectionBound::EMPTY;
28 }
29
30 } // namespace
31
32 ui::SelectionBound ConvertSelectionBound(
33 const cc::ViewportSelectionBound& bound) {
34 ui::SelectionBound ui_bound;
35 ui_bound.set_type(ConvertSelectionBoundType(bound.type));
36 ui_bound.set_visible(bound.visible);
37 if (ui_bound.type() != ui::SelectionBound::EMPTY)
38 ui_bound.SetEdge(bound.edge_top, bound.edge_bottom);
39 return ui_bound;
40 }
41
42 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698