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

Side by Side Diff: public/platform/WebSelectionBound.h

Issue 929213004: Plumb selection bounds as a single unit (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: TODO for moving WebSelectionBound Created 5 years, 8 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
« no previous file with comments | « public/platform/WebLayerTreeView.h ('k') | public/web/WebSelection.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/WebPoint.h"
9 9
10 namespace blink { 10 namespace blink {
11 11
12 // An endpoint for an active selection region. 12 // An endpoint for an active selection region.
13 // TODO(jdduke): Move this to web/ after downstream code adopts |WebSelection|.
13 struct WebSelectionBound { 14 struct WebSelectionBound {
15 // TODO(jdduke): Remove the type identifier after downstream code adopts
16 // |WebSelection| for determining bound orientation.
14 enum Type { 17 enum Type {
15 Caret, 18 Caret,
16 SelectionLeft, 19 SelectionLeft,
17 SelectionRight 20 SelectionRight
18 }; 21 };
19 22
20 explicit WebSelectionBound(Type type) 23 explicit WebSelectionBound(Type type)
21 : type(type) 24 : type(type)
22 , layerId(0) 25 , layerId(0)
26 , isTextDirectionRTL(false)
23 { 27 {
24 } 28 }
25 29
26 // The logical type of the endpoint. Note that this is dependent not only on 30 // 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. 31 // the bound's relative location, but also the underlying text direction.
28 Type type; 32 Type type;
29 33
30 // The id of the platform layer to which the bound should be anchored. 34 // The id of the platform layer to which the bound should be anchored.
31 int layerId; 35 int layerId;
32 36
33 // The bottom and top coordinates of the edge (caret), in layer coordinates, 37 // The bottom and top coordinates of the edge (caret), in layer coordinates,
34 // that define the selection bound. 38 // that define the selection bound.
35 WebPoint edgeTopInLayer; 39 WebPoint edgeTopInLayer;
36 WebPoint edgeBottomInLayer; 40 WebPoint edgeBottomInLayer;
41
42 // Whether the text direction at this location is RTL.
43 bool isTextDirectionRTL;
37 }; 44 };
38 45
39 } // namespace blink 46 } // namespace blink
40 47
41 #endif 48 #endif
OLDNEW
« no previous file with comments | « public/platform/WebLayerTreeView.h ('k') | public/web/WebSelection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698