| Index: third_party/WebKit/Source/web/WebSurroundingText.cpp
|
| diff --git a/third_party/WebKit/Source/web/WebSurroundingText.cpp b/third_party/WebKit/Source/web/WebSurroundingText.cpp
|
| index 1584e7c32a52731609e9da487dfc91fba4c482ec..cdd758ef53c6bfbda039d7bd194a1c21bdae44d2 100644
|
| --- a/third_party/WebKit/Source/web/WebSurroundingText.cpp
|
| +++ b/third_party/WebKit/Source/web/WebSurroundingText.cpp
|
| @@ -28,11 +28,13 @@
|
| #include "core/dom/Node.h"
|
| #include "core/dom/Range.h"
|
| #include "core/dom/Text.h"
|
| +#include "core/editing/FrameSelection.h"
|
| #include "core/editing/SurroundingText.h"
|
| #include "core/editing/VisiblePosition.h"
|
| #include "core/layout/LayoutObject.h"
|
| #include "public/platform/WebPoint.h"
|
| #include "public/web/WebHitTestResult.h"
|
| +#include "web/WebLocalFrameImpl.h"
|
|
|
| namespace blink {
|
|
|
| @@ -53,9 +55,10 @@ void WebSurroundingText::initialize(const WebNode& webNode, const WebPoint& node
|
| m_private.reset(new SurroundingText(createVisiblePosition(node->layoutObject()->positionForPoint(static_cast<IntPoint>(nodePoint))).deepEquivalent().parentAnchoredEquivalent(), maxLength));
|
| }
|
|
|
| -void WebSurroundingText::initialize(const WebRange& webRange, size_t maxLength)
|
| +void WebSurroundingText::initializeFromCurrentSelection(WebLocalFrame* frame, size_t maxLength)
|
| {
|
| - if (Range* range = static_cast<Range*>(webRange))
|
| + LocalFrame* webFrame = toWebLocalFrameImpl(frame)->frame();
|
| + if (Range* range = createRange(webFrame->selection().selection().toNormalizedEphemeralRange()))
|
| m_private.reset(new SurroundingText(*range, maxLength));
|
| }
|
|
|
|
|