OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "cc/output/viewport_selection_bound.h" | 8 #include "cc/output/viewport_selection_bound.h" |
9 #include "ui/base/touch/selection_bound.h" | 9 #include "ui/base/touch/selection_bound.h" |
10 #include "ui/gfx/geometry/point_conversions.h" | 10 #include "ui/gfx/geometry/point_conversions.h" |
11 #include "ui/gfx/rect.h" | 11 #include "ui/gfx/geometry/rect.h" |
12 | 12 |
13 namespace ui { | 13 namespace ui { |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 SelectionBound::Type ConvertToSelectionBoundType(cc::SelectionBoundType type) { | 17 SelectionBound::Type ConvertToSelectionBoundType(cc::SelectionBoundType type) { |
18 switch (type) { | 18 switch (type) { |
19 case cc::SELECTION_BOUND_LEFT: | 19 case cc::SELECTION_BOUND_LEFT: |
20 return SelectionBound::LEFT; | 20 return SelectionBound::LEFT; |
21 case cc::SELECTION_BOUND_RIGHT: | 21 case cc::SELECTION_BOUND_RIGHT: |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 gfx::Point bottom_right(b1.edge_top_rounded()); | 84 gfx::Point bottom_right(b1.edge_top_rounded()); |
85 bottom_right.SetToMax(b1.edge_bottom_rounded()); | 85 bottom_right.SetToMax(b1.edge_bottom_rounded()); |
86 bottom_right.SetToMax(b2.edge_top_rounded()); | 86 bottom_right.SetToMax(b2.edge_top_rounded()); |
87 bottom_right.SetToMax(b2.edge_bottom_rounded()); | 87 bottom_right.SetToMax(b2.edge_bottom_rounded()); |
88 | 88 |
89 gfx::Vector2d diff = bottom_right - top_left; | 89 gfx::Vector2d diff = bottom_right - top_left; |
90 return gfx::Rect(top_left, gfx::Size(diff.x(), diff.y())); | 90 return gfx::Rect(top_left, gfx::Size(diff.x(), diff.y())); |
91 } | 91 } |
92 | 92 |
93 } // namespace ui | 93 } // namespace ui |
OLD | NEW |