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

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

Issue 1177173007: Templatize FrameSelection::setNonDirectionalSelectionIfNeede function (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-06-18T14:23:09 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') | Source/core/editing/VisibleSelection.cpp » ('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 29 matching lines...) Expand all
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 { 46 class InDOMTree {
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 PositionType selectionBase(const VisibleSelection& selection) { r eturn selection.base(); } 51 static PositionType selectionBase(const VisibleSelection& selection) { r eturn selection.base(); }
51 static PositionType selectionExtent(const VisibleSelection& selection) { return selection.extent(); } 52 static PositionType selectionExtent(const VisibleSelection& selection) { return selection.extent(); }
52 static PositionType selectionStart(const VisibleSelection& selection) { return selection.start(); } 53 static PositionType selectionStart(const VisibleSelection& selection) { return selection.start(); }
53 static PositionType selectionEnd(const VisibleSelection& selection) { re turn selection.end(); } 54 static PositionType selectionEnd(const VisibleSelection& selection) { re turn selection.end(); }
54 }; 55 };
55 56
56 VisibleSelection(); 57 VisibleSelection();
57 58
58 VisibleSelection(const Position&, EAffinity, bool isDirectional = false); 59 VisibleSelection(const Position&, EAffinity, bool isDirectional = false);
59 VisibleSelection(const Position&, const Position&, EAffinity = SEL_DEFAULT_A FFINITY, bool isDirectional = false); 60 VisibleSelection(const Position&, const Position&, EAffinity = SEL_DEFAULT_A FFINITY, bool isDirectional = false);
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 210
210 } // namespace blink 211 } // namespace blink
211 212
212 #ifndef NDEBUG 213 #ifndef NDEBUG
213 // Outside the WebCore namespace for ease of invocation from gdb. 214 // Outside the WebCore namespace for ease of invocation from gdb.
214 void showTree(const blink::VisibleSelection&); 215 void showTree(const blink::VisibleSelection&);
215 void showTree(const blink::VisibleSelection*); 216 void showTree(const blink::VisibleSelection*);
216 #endif 217 #endif
217 218
218 #endif // VisibleSelection_h 219 #endif // VisibleSelection_h
OLDNEW
« no previous file with comments | « Source/core/editing/FrameSelection.cpp ('k') | Source/core/editing/VisibleSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698