OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(FrameSelection); | 61 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(FrameSelection); |
62 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FrameSelection); | 62 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FrameSelection); |
63 public: | 63 public: |
64 static PassOwnPtrWillBeRawPtr<FrameSelection> create(LocalFrame* frame = nul
lptr) | 64 static PassOwnPtrWillBeRawPtr<FrameSelection> create(LocalFrame* frame = nul
lptr) |
65 { | 65 { |
66 return adoptPtrWillBeNoop(new FrameSelection(frame)); | 66 return adoptPtrWillBeNoop(new FrameSelection(frame)); |
67 } | 67 } |
68 virtual ~FrameSelection(); | 68 virtual ~FrameSelection(); |
69 | 69 |
70 enum EAlteration { AlterationMove, AlterationExtend }; | 70 enum EAlteration { AlterationMove, AlterationExtend }; |
71 enum CursorAlignOnScroll { AlignCursorOnScrollIfNeeded, | 71 enum CursorAlignOnScroll { AlignCursorOnScrollIfNeeded, AlignCursorOnScrollA
lways }; |
72 AlignCursorOnScrollAlways }; | |
73 enum SetSelectionOption { | 72 enum SetSelectionOption { |
74 // 1 << 0 is reserved for EUserTriggered | 73 // 1 << 0 is reserved for EUserTriggered |
75 CloseTyping = 1 << 1, | 74 CloseTyping = 1 << 1, |
76 ClearTypingStyle = 1 << 2, | 75 ClearTypingStyle = 1 << 2, |
77 SpellCorrectionTriggered = 1 << 3, | 76 SpellCorrectionTriggered = 1 << 3, |
78 DoNotSetFocus = 1 << 4, | 77 DoNotSetFocus = 1 << 4, |
79 DoNotUpdateAppearance = 1 << 5, | 78 DoNotUpdateAppearance = 1 << 5, |
80 DoNotClearStrategy = 1 << 6, | 79 DoNotClearStrategy = 1 << 6, |
81 }; | 80 }; |
82 typedef unsigned SetSelectionOptions; // Union of values in SetSelectionOpti
on and EUserTriggered | 81 typedef unsigned SetSelectionOptions; // Union of values in SetSelectionOpti
on and EUserTriggered |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 void setShouldShowBlockCursor(bool); | 231 void setShouldShowBlockCursor(bool); |
233 | 232 |
234 // VisibleSelection::ChangeObserver interface. | 233 // VisibleSelection::ChangeObserver interface. |
235 void didChangeVisibleSelection() override; | 234 void didChangeVisibleSelection() override; |
236 | 235 |
237 DECLARE_VIRTUAL_TRACE(); | 236 DECLARE_VIRTUAL_TRACE(); |
238 | 237 |
239 private: | 238 private: |
240 explicit FrameSelection(LocalFrame*); | 239 explicit FrameSelection(LocalFrame*); |
241 | 240 |
242 enum EPositionType { START, END, BASE, EXTENT }; | 241 // TODO(yosin) We should use capitalized name for |EPositionType|. |
| 242 enum EPositionType { START, END, BASE, EXTENT }; // NOLINT |
243 | 243 |
244 template <typename Strategy> | 244 template <typename Strategy> |
245 bool containsAlgorithm(const LayoutPoint&); | 245 bool containsAlgorithm(const LayoutPoint&); |
246 | 246 |
247 template <typename Strategy> | 247 template <typename Strategy> |
248 void setNonDirectionalSelectionIfNeededAlgorithm(const VisibleSelection&, Te
xtGranularity, EndPointsAdjustmentMode); | 248 void setNonDirectionalSelectionIfNeededAlgorithm(const VisibleSelection&, Te
xtGranularity, EndPointsAdjustmentMode); |
249 | 249 |
250 void respondToNodeModification(Node&, bool baseRemoved, bool extentRemoved,
bool startRemoved, bool endRemoved); | 250 void respondToNodeModification(Node&, bool baseRemoved, bool extentRemoved,
bool startRemoved, bool endRemoved); |
251 TextDirection directionOfEnclosingBlock(); | 251 TextDirection directionOfEnclosingBlock(); |
252 TextDirection directionOfSelection(); | 252 TextDirection directionOfSelection(); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 } | 339 } |
340 } // namespace blink | 340 } // namespace blink |
341 | 341 |
342 #ifndef NDEBUG | 342 #ifndef NDEBUG |
343 // Outside the WebCore namespace for ease of invocation from gdb. | 343 // Outside the WebCore namespace for ease of invocation from gdb. |
344 void showTree(const blink::FrameSelection&); | 344 void showTree(const blink::FrameSelection&); |
345 void showTree(const blink::FrameSelection*); | 345 void showTree(const blink::FrameSelection*); |
346 #endif | 346 #endif |
347 | 347 |
348 #endif // FrameSelection_h | 348 #endif // FrameSelection_h |
OLD | NEW |