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

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

Issue 2887303002: Blink caret only if selection has focus. (Closed)
Patch Set: update Created 3 years, 7 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 | « no previous file | third_party/WebKit/Source/core/editing/FrameCaret.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, 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 // For unit tests. 85 // For unit tests.
86 const DisplayItemClient& CaretDisplayItemClientForTesting() const; 86 const DisplayItemClient& CaretDisplayItemClientForTesting() const;
87 const LayoutBlock* CaretLayoutBlockForTesting() const; 87 const LayoutBlock* CaretLayoutBlockForTesting() const;
88 bool ShouldPaintCaretForTesting() const { return should_paint_caret_; } 88 bool ShouldPaintCaretForTesting() const { return should_paint_caret_; }
89 void RecreateCaretBlinkTimerForTesting(RefPtr<WebTaskRunner>); 89 void RecreateCaretBlinkTimerForTesting(RefPtr<WebTaskRunner>);
90 90
91 DECLARE_TRACE(); 91 DECLARE_TRACE();
92 92
93 private: 93 private:
94 friend class FrameCaretTest;
94 friend class FrameSelectionTest; 95 friend class FrameSelectionTest;
95 96
96 const PositionWithAffinity CaretPosition() const; 97 const PositionWithAffinity CaretPosition() const;
97 98
98 bool ShouldBlinkCaret() const; 99 bool ShouldBlinkCaret() const;
99 void CaretBlinkTimerFired(TimerBase*); 100 void CaretBlinkTimerFired(TimerBase*);
100 bool CaretPositionIsValidForDocument(const Document&) const; 101 bool CaretPositionIsValidForDocument(const Document&) const;
101 void UpdateAppearance(); 102 void UpdateAppearance();
102 103
103 const Member<const SelectionEditor> selection_editor_; 104 const Member<const SelectionEditor> selection_editor_;
104 const Member<LocalFrame> frame_; 105 const Member<LocalFrame> frame_;
105 const std::unique_ptr<CaretDisplayItemClient> display_item_client_; 106 const std::unique_ptr<CaretDisplayItemClient> display_item_client_;
106 CaretVisibility caret_visibility_; 107 CaretVisibility caret_visibility_;
107 // TODO(https://crbug.com/668758): Consider using BeginFrame update for this. 108 // TODO(https://crbug.com/668758): Consider using BeginFrame update for this.
108 std::unique_ptr<TaskRunnerTimer<FrameCaret>> caret_blink_timer_; 109 std::unique_ptr<TaskRunnerTimer<FrameCaret>> caret_blink_timer_;
109 bool should_paint_caret_ : 1; 110 bool should_paint_caret_ : 1;
110 bool is_caret_blinking_suspended_ : 1; 111 bool is_caret_blinking_suspended_ : 1;
111 bool should_show_block_cursor_ : 1; 112 bool should_show_block_cursor_ : 1;
112 113
113 DISALLOW_COPY_AND_ASSIGN(FrameCaret); 114 DISALLOW_COPY_AND_ASSIGN(FrameCaret);
114 }; 115 };
115 116
116 } // namespace blink 117 } // namespace blink
117 118
118 #endif // FrameCaret_h 119 #endif // FrameCaret_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/FrameCaret.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698