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

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: Fix test Created 5 years, 9 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 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 struct WebSelectionBound { 13 struct WebSelectionBound {
14 // TODO(jdduke): Remove this logic when downstream code adopts
15 // |WebSelection| for determining bound orientation.
14 enum Type { 16 enum Type {
15 Caret, 17 Caret,
16 SelectionLeft, 18 SelectionLeft,
17 SelectionRight 19 SelectionRight
18 }; 20 };
19 21
20 explicit WebSelectionBound(Type type) 22 explicit WebSelectionBound(Type type)
21 : type(type) 23 : type(type)
22 , layerId(0) 24 , layerId(0)
25 , isTextDirectionRTL(false)
23 { 26 {
24 } 27 }
25 28
26 // The logical type of the endpoint. Note that this is dependent not only on 29 // 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. 30 // the bound's relative location, but also the underlying text direction.
28 Type type; 31 Type type;
29 32
30 // The id of the platform layer to which the bound should be anchored. 33 // The id of the platform layer to which the bound should be anchored.
31 int layerId; 34 int layerId;
32 35
33 // The bottom and top coordinates of the edge (caret), in layer coordinates, 36 // The bottom and top coordinates of the edge (caret), in layer coordinates,
34 // that define the selection bound. 37 // that define the selection bound.
35 WebPoint edgeTopInLayer; 38 WebPoint edgeTopInLayer;
36 WebPoint edgeBottomInLayer; 39 WebPoint edgeBottomInLayer;
40
41 // Whether the text direction at this location is RTL.
42 bool isTextDirectionRTL;
37 }; 43 };
38 44
39 } // namespace blink 45 } // namespace blink
40 46
41 #endif 47 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698