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

Side by Side Diff: third_party/WebKit/Source/core/editing/FrameSelection.h

Issue 2647283006: Removing HandleVisible enum from FrameSelection (Closed)
Patch Set: Rebase Created 3 years, 10 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, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 enum EAlteration { AlterationMove, AlterationExtend }; 84 enum EAlteration { AlterationMove, AlterationExtend };
85 enum SetSelectionOption { 85 enum SetSelectionOption {
86 // 1 << 0 is reserved for EUserTriggered 86 // 1 << 0 is reserved for EUserTriggered
87 CloseTyping = 1 << 1, 87 CloseTyping = 1 << 1,
88 ClearTypingStyle = 1 << 2, 88 ClearTypingStyle = 1 << 2,
89 DoNotSetFocus = 1 << 3, 89 DoNotSetFocus = 1 << 3,
90 DoNotUpdateAppearance = 1 << 4, 90 DoNotUpdateAppearance = 1 << 4,
91 DoNotClearStrategy = 1 << 5, 91 DoNotClearStrategy = 1 << 5,
92 DoNotAdjustInFlatTree = 1 << 6, 92 DoNotAdjustInFlatTree = 1 << 6,
93 HandleVisible = 1 << 7,
94 }; 93 };
95 // Union of values in SetSelectionOption and EUserTriggered 94 // Union of values in SetSelectionOption and EUserTriggered
96 typedef unsigned SetSelectionOptions; 95 typedef unsigned SetSelectionOptions;
97 static inline EUserTriggered selectionOptionsToUserTriggered( 96 static inline EUserTriggered selectionOptionsToUserTriggered(
98 SetSelectionOptions options) { 97 SetSelectionOptions options) {
99 return static_cast<EUserTriggered>(options & UserTriggered); 98 return static_cast<EUserTriggered>(options & UserTriggered);
100 } 99 }
101 100
102 bool isAvailable() const { return m_document; } 101 bool isAvailable() const { return m_document; }
103 // You should not call |document()| when |!isAvailable()|. 102 // You should not call |document()| when |!isAvailable()|.
(...skipping 26 matching lines...) Expand all
130 TextGranularity = CharacterGranularity); 129 TextGranularity = CharacterGranularity);
131 130
132 void setSelection(const SelectionInFlatTree&, 131 void setSelection(const SelectionInFlatTree&,
133 SetSelectionOptions = CloseTyping | ClearTypingStyle, 132 SetSelectionOptions = CloseTyping | ClearTypingStyle,
134 CursorAlignOnScroll = CursorAlignOnScroll::IfNeeded, 133 CursorAlignOnScroll = CursorAlignOnScroll::IfNeeded,
135 TextGranularity = CharacterGranularity); 134 TextGranularity = CharacterGranularity);
136 135
137 // TODO(yosin): We should use |SelectionInDOMTree| version instead of 136 // TODO(yosin): We should use |SelectionInDOMTree| version instead of
138 // |VisibleSelection| version. 137 // |VisibleSelection| version.
139 void setSelection(const VisibleSelection&, 138 void setSelection(const VisibleSelection&,
139 HandleVisibility = HandleVisibility::NotVisible,
140 SetSelectionOptions = CloseTyping | ClearTypingStyle, 140 SetSelectionOptions = CloseTyping | ClearTypingStyle,
141 CursorAlignOnScroll = CursorAlignOnScroll::IfNeeded, 141 CursorAlignOnScroll = CursorAlignOnScroll::IfNeeded,
142 TextGranularity = CharacterGranularity); 142 TextGranularity = CharacterGranularity);
143 // TODO(yosin): We should use |SelectionInFlatTree| version instead of 143 // TODO(yosin): We should use |SelectionInFlatTree| version instead of
144 // |VisibleSelectionInFlatTree| version. 144 // |VisibleSelectionInFlatTree| version.
145 void setSelection(const VisibleSelectionInFlatTree&, 145 void setSelection(const VisibleSelectionInFlatTree&,
146 HandleVisibility = HandleVisibility::NotVisible,
146 SetSelectionOptions = CloseTyping | ClearTypingStyle, 147 SetSelectionOptions = CloseTyping | ClearTypingStyle,
147 CursorAlignOnScroll = CursorAlignOnScroll::IfNeeded, 148 CursorAlignOnScroll = CursorAlignOnScroll::IfNeeded,
148 TextGranularity = CharacterGranularity); 149 TextGranularity = CharacterGranularity);
149 bool setSelectedRange( 150 bool setSelectedRange(
150 const EphemeralRange&, 151 const EphemeralRange&,
151 TextAffinity, 152 TextAffinity,
152 SelectionDirectionalMode = SelectionDirectionalMode::NonDirectional, 153 SelectionDirectionalMode = SelectionDirectionalMode::NonDirectional,
153 FrameSelection::SetSelectionOptions = CloseTyping | ClearTypingStyle); 154 FrameSelection::SetSelectionOptions = CloseTyping | ClearTypingStyle);
154 void selectAll(); 155 void selectAll();
155 void clear(); 156 void clear();
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 291
291 // For |PaintControllerPaintTestForSlimmingPaintV1AndV2|. 292 // For |PaintControllerPaintTestForSlimmingPaintV1AndV2|.
292 const DisplayItemClient& caretDisplayItemClientForTesting() const; 293 const DisplayItemClient& caretDisplayItemClientForTesting() const;
293 294
294 // Note: We have |selectionInFlatTree()| for unit tests, we should 295 // Note: We have |selectionInFlatTree()| for unit tests, we should
295 // use |visibleSelection<EditingInFlatTreeStrategy>()|. 296 // use |visibleSelection<EditingInFlatTreeStrategy>()|.
296 const VisibleSelectionInFlatTree& selectionInFlatTree() const; 297 const VisibleSelectionInFlatTree& selectionInFlatTree() const;
297 298
298 template <typename Strategy> 299 template <typename Strategy>
299 void setSelectionAlgorithm(const VisibleSelectionTemplate<Strategy>&, 300 void setSelectionAlgorithm(const VisibleSelectionTemplate<Strategy>&,
301 HandleVisibility,
300 SetSelectionOptions, 302 SetSelectionOptions,
301 CursorAlignOnScroll, 303 CursorAlignOnScroll,
302 TextGranularity); 304 TextGranularity);
303 305
304 void respondToNodeModification(Node&, 306 void respondToNodeModification(Node&,
305 bool baseRemoved, 307 bool baseRemoved,
306 bool extentRemoved, 308 bool extentRemoved,
307 bool startRemoved, 309 bool startRemoved,
308 bool endRemoved); 310 bool endRemoved);
309 311
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 363
362 } // namespace blink 364 } // namespace blink
363 365
364 #ifndef NDEBUG 366 #ifndef NDEBUG
365 // Outside the WebCore namespace for ease of invocation from gdb. 367 // Outside the WebCore namespace for ease of invocation from gdb.
366 void showTree(const blink::FrameSelection&); 368 void showTree(const blink::FrameSelection&);
367 void showTree(const blink::FrameSelection*); 369 void showTree(const blink::FrameSelection*);
368 #endif 370 #endif
369 371
370 #endif // FrameSelection_h 372 #endif // FrameSelection_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698