Index: third_party/WebKit/Source/core/editing/DragCaretController.cpp |
diff --git a/third_party/WebKit/Source/core/editing/DragCaretController.cpp b/third_party/WebKit/Source/core/editing/DragCaretController.cpp |
index 32464e386ed3ea5f1d058feaf2096c576cc54a0d..b19c5fffb3bb841da91e8bcb8d0ee7963dfa8ddc 100644 |
--- a/third_party/WebKit/Source/core/editing/DragCaretController.cpp |
+++ b/third_party/WebKit/Source/core/editing/DragCaretController.cpp |
@@ -26,6 +26,7 @@ |
#include "core/editing/DragCaretController.h" |
#include "core/editing/EditingUtilities.h" |
+#include "core/frame/Settings.h" |
#include "core/layout/api/LayoutViewItem.h" |
#include "core/paint/PaintLayer.h" |
@@ -41,6 +42,19 @@ DragCaretController* DragCaretController::create() |
return new DragCaretController; |
} |
+bool DragCaretController::hasCaretIn(const LayoutBlock& layoutBlock) const |
+{ |
+ Node* node = m_position.deepEquivalent().anchorNode(); |
+ if (!node) |
+ return false; |
+ if (layoutBlock != CaretBase::caretLayoutObject(node)) |
+ return false; |
+ if (rootEditableElementOf(m_position)) |
+ return true; |
+ Settings* settings = node->ownerDocument()->frame()->settings(); |
+ return settings && settings->caretBrowsingEnabled(); |
+} |
+ |
bool DragCaretController::isContentRichlyEditable() const |
{ |
return isRichlyEditablePosition(m_position.deepEquivalent()); |
@@ -102,16 +116,6 @@ DEFINE_TRACE(DragCaretController) |
visitor->trace(m_caretBase); |
} |
-LayoutBlock* DragCaretController::caretLayoutObject() const |
-{ |
- return CaretBase::caretLayoutObject(m_position.deepEquivalent().anchorNode()); |
-} |
- |
-bool DragCaretController::isContentEditable() const |
-{ |
- return rootEditableElementOf(m_position); |
-} |
- |
void DragCaretController::paintDragCaret(LocalFrame* frame, GraphicsContext& context, const LayoutPoint& paintOffset) const |
{ |
if (m_position.deepEquivalent().anchorNode()->document().frame() == frame) |