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

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

Issue 1182253004: Templatize FrameSelection::contains function (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-06-18T19:15:03 Rebase 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 | « Source/core/editing/FrameSelection.cpp ('k') | no next file » | 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 public: 47 public:
48 using PositionType = Position; 48 using PositionType = Position;
49 49
50 static bool equalSelections(const VisibleSelection&, const VisibleSelect ion&); 50 static bool equalSelections(const VisibleSelection&, const VisibleSelect ion&);
51 static PositionType selectionBase(const VisibleSelection& selection) { r eturn selection.base(); } 51 static PositionType selectionBase(const VisibleSelection& selection) { r eturn selection.base(); }
52 static PositionType selectionExtent(const VisibleSelection& selection) { return selection.extent(); } 52 static PositionType selectionExtent(const VisibleSelection& selection) { return selection.extent(); }
53 static PositionType selectionStart(const VisibleSelection& selection) { return selection.start(); } 53 static PositionType selectionStart(const VisibleSelection& selection) { return selection.start(); }
54 static PositionType selectionEnd(const VisibleSelection& selection) { re turn selection.end(); } 54 static PositionType selectionEnd(const VisibleSelection& selection) { re turn selection.end(); }
55 static VisiblePosition selectionVisibleStart(const VisibleSelection& sel ection) { return selection.visibleStart(); } 55 static VisiblePosition selectionVisibleStart(const VisibleSelection& sel ection) { return selection.visibleStart(); }
56 static VisiblePosition selectionVisibleEnd(const VisibleSelection& selec tion) { return selection.visibleEnd(); } 56 static VisiblePosition selectionVisibleEnd(const VisibleSelection& selec tion) { return selection.visibleEnd(); }
57 static PositionType toPositionType(const Position& position) { return po sition; }
57 }; 58 };
58 59
59 VisibleSelection(); 60 VisibleSelection();
60 61
61 VisibleSelection(const Position&, EAffinity, bool isDirectional = false); 62 VisibleSelection(const Position&, EAffinity, bool isDirectional = false);
62 VisibleSelection(const Position&, const Position&, EAffinity = SEL_DEFAULT_A FFINITY, bool isDirectional = false); 63 VisibleSelection(const Position&, const Position&, EAffinity = SEL_DEFAULT_A FFINITY, bool isDirectional = false);
63 64
64 explicit VisibleSelection(const Range*, EAffinity = SEL_DEFAULT_AFFINITY, bo ol isDirectional = false); 65 explicit VisibleSelection(const Range*, EAffinity = SEL_DEFAULT_AFFINITY, bo ol isDirectional = false);
65 66
66 explicit VisibleSelection(const VisiblePosition&, bool isDirectional = false ); 67 explicit VisibleSelection(const VisiblePosition&, bool isDirectional = false );
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 213
213 } // namespace blink 214 } // namespace blink
214 215
215 #ifndef NDEBUG 216 #ifndef NDEBUG
216 // Outside the WebCore namespace for ease of invocation from gdb. 217 // Outside the WebCore namespace for ease of invocation from gdb.
217 void showTree(const blink::VisibleSelection&); 218 void showTree(const blink::VisibleSelection&);
218 void showTree(const blink::VisibleSelection*); 219 void showTree(const blink::VisibleSelection*);
219 #endif 220 #endif
220 221
221 #endif // VisibleSelection_h 222 #endif // VisibleSelection_h
OLDNEW
« no previous file with comments | « Source/core/editing/FrameSelection.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698