| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 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 20 matching lines...) Expand all Loading... |
| 31 #include "platform/geometry/IntRect.h" | 31 #include "platform/geometry/IntRect.h" |
| 32 | 32 |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 class SelectionEditor; | 35 class SelectionEditor; |
| 36 | 36 |
| 37 enum class CaretVisibility { Visible, Hidden }; | 37 enum class CaretVisibility { Visible, Hidden }; |
| 38 | 38 |
| 39 class CORE_EXPORT FrameCaret final : public CaretBase { | 39 class CORE_EXPORT FrameCaret final : public CaretBase { |
| 40 public: | 40 public: |
| 41 FrameCaret(LocalFrame*, const SelectionEditor&); | 41 FrameCaret(LocalFrame&, const SelectionEditor&); |
| 42 ~FrameCaret() override; | 42 ~FrameCaret() override; |
| 43 | 43 |
| 44 bool isActive() const { return caretPosition().isNotNull(); } | 44 bool isActive() const { return caretPosition().isNotNull(); } |
| 45 | 45 |
| 46 void updateAppearance(); | 46 void updateAppearance(); |
| 47 | 47 |
| 48 // Used to suspend caret blinking while the mouse is down. | 48 // Used to suspend caret blinking while the mouse is down. |
| 49 void setCaretBlinkingSuspended(bool suspended) { | 49 void setCaretBlinkingSuspended(bool suspended) { |
| 50 m_isCaretBlinkingSuspended = suspended; | 50 m_isCaretBlinkingSuspended = suspended; |
| 51 } | 51 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 const Member<const SelectionEditor> m_selectionEditor; | 89 const Member<const SelectionEditor> m_selectionEditor; |
| 90 const Member<LocalFrame> m_frame; | 90 const Member<LocalFrame> m_frame; |
| 91 // The last node which painted the caret. Retained for clearing the old | 91 // The last node which painted the caret. Retained for clearing the old |
| 92 // caret when it moves. | 92 // caret when it moves. |
| 93 Member<Node> m_previousCaretNode; | 93 Member<Node> m_previousCaretNode; |
| 94 Member<Node> m_previousCaretAnchorNode; | 94 Member<Node> m_previousCaretAnchorNode; |
| 95 LayoutRect m_previousCaretRect; | 95 LayoutRect m_previousCaretRect; |
| 96 CaretVisibility m_caretVisibility; | 96 CaretVisibility m_caretVisibility; |
| 97 CaretVisibility m_previousCaretVisibility; | 97 CaretVisibility m_previousCaretVisibility; |
| 98 Timer<FrameCaret> m_caretBlinkTimer; | 98 // TODO(https://crbug.com/668758): Consider using BeginFrame update for this. |
| 99 TaskRunnerTimer<FrameCaret> m_caretBlinkTimer; |
| 99 bool m_caretRectDirty : 1; | 100 bool m_caretRectDirty : 1; |
| 100 bool m_shouldPaintCaret : 1; | 101 bool m_shouldPaintCaret : 1; |
| 101 bool m_isCaretBlinkingSuspended : 1; | 102 bool m_isCaretBlinkingSuspended : 1; |
| 102 bool m_shouldShowBlockCursor : 1; | 103 bool m_shouldShowBlockCursor : 1; |
| 103 }; | 104 }; |
| 104 | 105 |
| 105 } // namespace blink | 106 } // namespace blink |
| 106 | 107 |
| 107 #endif // FrameCaret_h | 108 #endif // FrameCaret_h |
| OLD | NEW |