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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 | 181 |
182 bool isAppearanceDirty() const; | 182 bool isAppearanceDirty() const; |
183 void commitAppearanceIfNeeded(LayoutView&); | 183 void commitAppearanceIfNeeded(LayoutView&); |
184 void updateAppearance(); | 184 void updateAppearance(); |
185 void setCaretVisible(bool caretIsVisible) { setCaretVisibility(caretIsVisibl
e ? Visible : Hidden); } | 185 void setCaretVisible(bool caretIsVisible) { setCaretVisibility(caretIsVisibl
e ? Visible : Hidden); } |
186 bool isCaretBoundsDirty() const { return m_caretRectDirty; } | 186 bool isCaretBoundsDirty() const { return m_caretRectDirty; } |
187 void setCaretRectNeedsUpdate(); | 187 void setCaretRectNeedsUpdate(); |
188 void scheduleVisualUpdate() const; | 188 void scheduleVisualUpdate() const; |
189 void invalidateCaretRect(); | 189 void invalidateCaretRect(); |
190 void paintCaret(GraphicsContext&, const LayoutPoint&); | 190 void paintCaret(GraphicsContext&, const LayoutPoint&); |
191 bool ShouldPaintCaretForTesting() const { return m_shouldPaintCaret; } | |
192 | 191 |
193 // Used to suspend caret blinking while the mouse is down. | 192 // Used to suspend caret blinking while the mouse is down. |
194 void setCaretBlinkingSuspended(bool suspended) { m_isCaretBlinkingSuspended
= suspended; } | 193 void setCaretBlinkingSuspended(bool suspended) { m_isCaretBlinkingSuspended
= suspended; } |
195 bool isCaretBlinkingSuspended() const { return m_isCaretBlinkingSuspended; } | 194 bool isCaretBlinkingSuspended() const { return m_isCaretBlinkingSuspended; } |
196 | 195 |
197 // Focus | 196 // Focus |
198 void setFocused(bool); | 197 void setFocused(bool); |
199 bool isFocused() const { return m_focused; } | 198 bool isFocused() const { return m_focused; } |
200 bool isFocusedAndActive() const; | 199 bool isFocusedAndActive() const; |
201 void pageActivationChanged(); | 200 void pageActivationChanged(); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 void setCaretVisibility(CaretVisibility); | 279 void setCaretVisibility(CaretVisibility); |
281 bool shouldBlinkCaret() const; | 280 bool shouldBlinkCaret() const; |
282 | 281 |
283 void updateSelectionIfNeeded(const Position& base, const Position& extent, c
onst Position& start, const Position& end); | 282 void updateSelectionIfNeeded(const Position& base, const Position& extent, c
onst Position& start, const Position& end); |
284 | 283 |
285 template <typename Strategy> | 284 template <typename Strategy> |
286 VisibleSelectionTemplate<Strategy> validateSelection(const VisibleSelectionT
emplate<Strategy>&); | 285 VisibleSelectionTemplate<Strategy> validateSelection(const VisibleSelectionT
emplate<Strategy>&); |
287 | 286 |
288 GranularityStrategy* granularityStrategy(); | 287 GranularityStrategy* granularityStrategy(); |
289 | 288 |
| 289 // For unittests |
| 290 bool shouldPaintCaretForTesting() const { return m_shouldPaintCaret; } |
| 291 bool isPreviousCaretDirtyForTesting() const { return m_previousCaretNode; } |
| 292 |
290 RawPtrWillBeMember<LocalFrame> m_frame; | 293 RawPtrWillBeMember<LocalFrame> m_frame; |
291 const OwnPtrWillBeMember<PendingSelection> m_pendingSelection; | 294 const OwnPtrWillBeMember<PendingSelection> m_pendingSelection; |
292 const OwnPtrWillBeMember<SelectionEditor> m_selectionEditor; | 295 const OwnPtrWillBeMember<SelectionEditor> m_selectionEditor; |
293 | 296 |
294 // Used to store base before the adjustment at bidi boundary | 297 // Used to store base before the adjustment at bidi boundary |
295 VisiblePosition m_originalBase; | 298 VisiblePosition m_originalBase; |
296 VisiblePositionInFlatTree m_originalBaseInFlatTree; | 299 VisiblePositionInFlatTree m_originalBaseInFlatTree; |
297 TextGranularity m_granularity; | 300 TextGranularity m_granularity; |
298 | 301 |
299 RefPtrWillBeMember<Node> m_previousCaretNode; // The last node which painted
the caret. Retained for clearing the old caret when it moves. | 302 RefPtrWillBeMember<Node> m_previousCaretNode; // The last node which painted
the caret. Retained for clearing the old caret when it moves. |
(...skipping 30 matching lines...) Expand all Loading... |
330 } | 333 } |
331 } // namespace blink | 334 } // namespace blink |
332 | 335 |
333 #ifndef NDEBUG | 336 #ifndef NDEBUG |
334 // Outside the WebCore namespace for ease of invocation from gdb. | 337 // Outside the WebCore namespace for ease of invocation from gdb. |
335 void showTree(const blink::FrameSelection&); | 338 void showTree(const blink::FrameSelection&); |
336 void showTree(const blink::FrameSelection*); | 339 void showTree(const blink::FrameSelection*); |
337 #endif | 340 #endif |
338 | 341 |
339 #endif // FrameSelection_h | 342 #endif // FrameSelection_h |
OLD | NEW |