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

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

Issue 2034863002: Move SelectionBound from ui/base/touch to ui/gfx to be used by cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated views_unittests Created 4 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/input/ui_touch_selection_helper.h" 5 #include "content/browser/renderer_host/input/ui_touch_selection_helper.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "cc/output/viewport_selection_bound.h" 8 #include "cc/output/viewport_selection_bound.h"
9 9
10 namespace content { 10 namespace content {
11 11
12 namespace { 12 namespace {
13 13
14 ui::SelectionBound::Type ConvertSelectionBoundType( 14 gfx::SelectionBound::Type ConvertSelectionBoundType(
15 cc::SelectionBoundType type) { 15 cc::SelectionBoundType type) {
16 switch (type) { 16 switch (type) {
17 case cc::SELECTION_BOUND_LEFT: 17 case cc::SELECTION_BOUND_LEFT:
18 return ui::SelectionBound::LEFT; 18 return gfx::SelectionBound::LEFT;
19 case cc::SELECTION_BOUND_RIGHT: 19 case cc::SELECTION_BOUND_RIGHT:
20 return ui::SelectionBound::RIGHT; 20 return gfx::SelectionBound::RIGHT;
21 case cc::SELECTION_BOUND_CENTER: 21 case cc::SELECTION_BOUND_CENTER:
22 return ui::SelectionBound::CENTER; 22 return gfx::SelectionBound::CENTER;
23 case cc::SELECTION_BOUND_EMPTY: 23 case cc::SELECTION_BOUND_EMPTY:
24 return ui::SelectionBound::EMPTY; 24 return gfx::SelectionBound::EMPTY;
25 } 25 }
26 NOTREACHED() << "Unknown selection bound type"; 26 NOTREACHED() << "Unknown selection bound type";
27 return ui::SelectionBound::EMPTY; 27 return gfx::SelectionBound::EMPTY;
28 } 28 }
29 29
30 } // namespace 30 } // namespace
31 31
32 ui::SelectionBound ConvertSelectionBound( 32 gfx::SelectionBound ConvertSelectionBound(
33 const cc::ViewportSelectionBound& bound) { 33 const cc::ViewportSelectionBound& bound) {
34 ui::SelectionBound ui_bound; 34 gfx::SelectionBound ui_bound;
35 ui_bound.set_type(ConvertSelectionBoundType(bound.type)); 35 ui_bound.set_type(ConvertSelectionBoundType(bound.type));
36 ui_bound.set_visible(bound.visible); 36 ui_bound.set_visible(bound.visible);
37 if (ui_bound.type() != ui::SelectionBound::EMPTY) 37 if (ui_bound.type() != gfx::SelectionBound::EMPTY)
38 ui_bound.SetEdge(bound.edge_top, bound.edge_bottom); 38 ui_bound.SetEdge(bound.edge_top, bound.edge_bottom);
39 return ui_bound; 39 return ui_bound;
40 } 40 }
41 41
42 } // namespace content 42 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698