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

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

Powered by Google App Engine
This is Rietveld 408576698