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 #ifndef WebSelectionBound_h | 5 #ifndef WebSelectionBound_h |
6 #define WebSelectionBound_h | 6 #define WebSelectionBound_h |
7 | 7 |
| 8 #include "public/platform/WebPoint.h" |
8 #include "public/platform/WebRect.h" | 9 #include "public/platform/WebRect.h" |
9 | 10 |
10 namespace blink { | 11 namespace blink { |
11 | 12 |
12 // An endpoint for an active selection region. | 13 // An endpoint for an active selection region. |
13 struct WebSelectionBound { | 14 struct WebSelectionBound { |
14 enum Type { | 15 enum Type { |
15 Caret, | 16 Caret, |
16 SelectionLeft, | 17 SelectionLeft, |
17 SelectionRight | 18 SelectionRight |
18 }; | 19 }; |
19 | 20 |
20 explicit WebSelectionBound(Type type) | 21 explicit WebSelectionBound(Type type) |
21 : type(type) | 22 : type(type) |
22 , layerId(0) | 23 , layerId(0) |
23 { | 24 { |
24 } | 25 } |
25 | 26 |
26 // The logical type of the endpoint. Note that this is dependent not only on | 27 // The logical type of the endpoint. Note that this is dependent not only on |
27 // the bound's relative location, but also the underlying text direction. | 28 // the bound's relative location, but also the underlying text direction. |
28 Type type; | 29 Type type; |
29 | 30 |
30 // The id of the platform layer to which the bound should be anchored. | 31 // The id of the platform layer to which the bound should be anchored. |
31 int layerId; | 32 int layerId; |
32 | 33 |
33 // The one-dimensional rect of the bound's edge in layer coordinates, not to | 34 // The one-dimensional rect of the bound's edge in layer coordinates, not to |
34 // be confused with the selection region. | 35 // be confused with the selection region. |
| 36 // FIXME: Remove when downstream code uses |edge{Top|Bottom}InLayer|, |
| 37 // crbug.com/405666. |
35 WebRect edgeRectInLayer; | 38 WebRect edgeRectInLayer; |
| 39 |
| 40 // The bottom and top coordinates of the edge (caret), in layer coordinates, |
| 41 // that define the selection bound. |
| 42 WebPoint edgeTopInLayer; |
| 43 WebPoint edgeBottomInLayer; |
36 }; | 44 }; |
37 | 45 |
38 } // namespace blink | 46 } // namespace blink |
39 | 47 |
40 #endif | 48 #endif |
OLD | NEW |