Home | History | Annotate | Download | only in platform
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef WebSelectionBound_h
      6 #define WebSelectionBound_h
      7 
      8 #include "public/platform/WebPoint.h"
      9 
     10 namespace blink {
     11 
     12 // An endpoint for an active selection region.
     13 struct WebSelectionBound {
     14     enum Type {
     15         Caret,
     16         SelectionLeft,
     17         SelectionRight
     18     };
     19 
     20     explicit WebSelectionBound(Type type)
     21         : type(type)
     22         , layerId(0)
     23     {
     24     }
     25 
     26     // 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     Type type;
     29 
     30     // The id of the platform layer to which the bound should be anchored.
     31     int layerId;
     32 
     33     // The bottom and top coordinates of the edge (caret), in layer coordinates,
     34     // that define the selection bound.
     35     WebPoint edgeTopInLayer;
     36     WebPoint edgeBottomInLayer;
     37 };
     38 
     39 } // namespace blink
     40 
     41 #endif
     42