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

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-18T14:44:59 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
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(VisibleSelection); 44 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(VisibleSelection);
45 public: 45 public:
46 class InDOMTree { 46 class InDOMTree {
47 public: 47 public:
48 using PositionType = Position; 48 using PositionType = Position;
49 49
50 static PositionType selectionBase(const VisibleSelection& selection) { r eturn selection.base(); } 50 static PositionType selectionBase(const VisibleSelection& selection) { r eturn selection.base(); }
51 static PositionType selectionExtent(const VisibleSelection& selection) { return selection.extent(); } 51 static PositionType selectionExtent(const VisibleSelection& selection) { return selection.extent(); }
52 static PositionType selectionStart(const VisibleSelection& selection) { return selection.start(); } 52 static PositionType selectionStart(const VisibleSelection& selection) { return selection.start(); }
53 static PositionType selectionEnd(const VisibleSelection& selection) { re turn selection.end(); } 53 static PositionType selectionEnd(const VisibleSelection& selection) { re turn selection.end(); }
54 static VisiblePosition selectionVisibleStart(const VisibleSelection& sel ection) { return selection.visibleStart(); }
55 static VisiblePosition selectionVisibleEnd(const VisibleSelection& selec tion) { return selection.visibleEnd(); }
56 static PositionType toPositionType(const Position& position) { return po sition; }
54 }; 57 };
55 58
56 VisibleSelection(); 59 VisibleSelection();
57 60
58 VisibleSelection(const Position&, EAffinity, bool isDirectional = false); 61 VisibleSelection(const Position&, EAffinity, bool isDirectional = false);
59 VisibleSelection(const Position&, const Position&, EAffinity = SEL_DEFAULT_A FFINITY, bool isDirectional = false); 62 VisibleSelection(const Position&, const Position&, EAffinity = SEL_DEFAULT_A FFINITY, bool isDirectional = false);
60 63
61 explicit VisibleSelection(const Range*, EAffinity = SEL_DEFAULT_AFFINITY, bo ol isDirectional = false); 64 explicit VisibleSelection(const Range*, EAffinity = SEL_DEFAULT_AFFINITY, bo ol isDirectional = false);
62 65
63 explicit VisibleSelection(const VisiblePosition&, bool isDirectional = false ); 66 explicit VisibleSelection(const VisiblePosition&, bool isDirectional = false );
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 212
210 } // namespace blink 213 } // namespace blink
211 214
212 #ifndef NDEBUG 215 #ifndef NDEBUG
213 // Outside the WebCore namespace for ease of invocation from gdb. 216 // Outside the WebCore namespace for ease of invocation from gdb.
214 void showTree(const blink::VisibleSelection&); 217 void showTree(const blink::VisibleSelection&);
215 void showTree(const blink::VisibleSelection*); 218 void showTree(const blink::VisibleSelection*);
216 #endif 219 #endif
217 220
218 #endif // VisibleSelection_h 221 #endif // VisibleSelection_h
OLDNEW
« Source/core/editing/FrameSelection.cpp ('K') | « Source/core/editing/FrameSelection.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698