Index: Source/core/paint/PaintDataCache.cpp |
diff --git a/Source/core/paint/PaintDataCache.cpp b/Source/core/paint/PaintDataCache.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f074b2e2b6da941eaaafbadeb8863e1ca9e3f6e4 |
--- /dev/null |
+++ b/Source/core/paint/PaintDataCache.cpp |
@@ -0,0 +1,32 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "config.h" |
+#include "core/paint/PaintDataCache.h" |
+ |
+#include "core/editing/Caret.h" |
+#include "core/editing/FrameSelection.h" |
+#include "core/frame/LocalFrame.h" |
+#include "core/frame/Settings.h" |
+#include "core/page/Page.h" |
+ |
+namespace blink { |
+ |
+void PaintDataCache::updateCaretCacheForFrame(const LocalFrame* frame) |
+{ |
+ m_caretFrame = frame; |
+ |
+ Settings* settings = frame->settings(); |
+ bool caretBrowsing = settings && settings->caretBrowsingEnabled(); |
+ |
+ const FrameSelection& selection = frame->selection(); |
+ m_cursorCaretLayoutObject = (selection.hasEditableStyle() || caretBrowsing) |
+ ? selection.caretLayoutObject() : nullptr; |
+ |
+ const DragCaretController& dragCaretController = frame->page()->dragCaretController(); |
+ m_dragCaretLayoutObject = (dragCaretController.isContentEditable() || caretBrowsing) |
+ ? dragCaretController.caretLayoutObject() : nullptr; |
+} |
+ |
+} // namespace blink |