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

Side by Side Diff: Source/core/editing/VisibleSelection.h

Issue 1189963003: Templatize PendingSelection class (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | Source/core/layout/PendingSelection.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 /* 1 /*
2 * Copyright (C) 2004 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2004 Apple Computer, Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 25 matching lines...) Expand all
36 36
37 class LayoutPoint; 37 class LayoutPoint;
38 38
39 const EAffinity SEL_DEFAULT_AFFINITY = DOWNSTREAM; 39 const EAffinity SEL_DEFAULT_AFFINITY = DOWNSTREAM;
40 enum SelectionDirection { DirectionForward, DirectionBackward, DirectionRight, D irectionLeft }; 40 enum SelectionDirection { DirectionForward, DirectionBackward, DirectionRight, D irectionLeft };
41 41
42 class CORE_EXPORT VisibleSelection { 42 class CORE_EXPORT VisibleSelection {
43 DISALLOW_ALLOCATION(); 43 DISALLOW_ALLOCATION();
44 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(VisibleSelection); 44 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(VisibleSelection);
45 public: 45 public:
46 class InDOMTree {
tkent 2015/06/17 08:14:28 The name |InDOMTree| sounds weird though I have no
47 public:
48 using PositionType = Position;
49
50 static PositionType selectionBase(const VisibleSelection& selection) { r eturn selection.base(); }
51 static PositionType selectionExtent(const VisibleSelection& selection) { return selection.extent(); }
52 static PositionType selectionStart(const VisibleSelection& selection) { return selection.start(); }
53 static PositionType selectionEnd(const VisibleSelection& selection) { re turn selection.end(); }
54 };
55
46 VisibleSelection(); 56 VisibleSelection();
47 57
48 VisibleSelection(const Position&, EAffinity, bool isDirectional = false); 58 VisibleSelection(const Position&, EAffinity, bool isDirectional = false);
49 VisibleSelection(const Position&, const Position&, EAffinity = SEL_DEFAULT_A FFINITY, bool isDirectional = false); 59 VisibleSelection(const Position&, const Position&, EAffinity = SEL_DEFAULT_A FFINITY, bool isDirectional = false);
50 60
51 explicit VisibleSelection(const Range*, EAffinity = SEL_DEFAULT_AFFINITY, bo ol isDirectional = false); 61 explicit VisibleSelection(const Range*, EAffinity = SEL_DEFAULT_AFFINITY, bo ol isDirectional = false);
52 62
53 explicit VisibleSelection(const VisiblePosition&, bool isDirectional = false ); 63 explicit VisibleSelection(const VisiblePosition&, bool isDirectional = false );
54 VisibleSelection(const VisiblePosition&, const VisiblePosition&, bool isDire ctional = false); 64 VisibleSelection(const VisiblePosition&, const VisiblePosition&, bool isDire ctional = false);
55 65
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 209
200 } // namespace blink 210 } // namespace blink
201 211
202 #ifndef NDEBUG 212 #ifndef NDEBUG
203 // Outside the WebCore namespace for ease of invocation from gdb. 213 // Outside the WebCore namespace for ease of invocation from gdb.
204 void showTree(const blink::VisibleSelection&); 214 void showTree(const blink::VisibleSelection&);
205 void showTree(const blink::VisibleSelection*); 215 void showTree(const blink::VisibleSelection*);
206 #endif 216 #endif
207 217
208 #endif // VisibleSelection_h 218 #endif // VisibleSelection_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/layout/PendingSelection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698