Commit e1c20efe authored by jam@chromium.org's avatar jam@chromium.org

Move didChangeSelection to WebFrameClient.

BUG=304341

Review URL: https://codereview.chromium.org/204673007

git-svn-id: svn://svn.chromium.org/blink/trunk@169603 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent c63fe18a
......@@ -525,7 +525,7 @@ bool Editor::shouldDeleteRange(Range* range) const
void Editor::notifyComponentsOnChangedSelection(const VisibleSelection& oldSelection, FrameSelection::SetSelectionOptions options)
{
client().respondToChangedSelection(m_frame.selection().selectionType());
client().respondToChangedSelection(&m_frame, m_frame.selection().selectionType());
setStartNewKillRingSequence(true);
}
......@@ -1045,7 +1045,7 @@ void Editor::changeSelectionAfterCommand(const VisibleSelection& newSelection,
// does not call EditorClient::respondToChangedSelection(), which, on the Mac, sends selection change notifications and
// starts a new kill ring sequence, but we want to do these things (matches AppKit).
if (selectionDidNotChangeDOMPosition)
client().respondToChangedSelection(m_frame.selection().selectionType());
client().respondToChangedSelection(&m_frame, m_frame.selection().selectionType());
}
IntRect Editor::firstRectForRange(Range* range) const
......
......@@ -289,7 +289,7 @@ public:
virtual ~EmptyEditorClient() { }
virtual void respondToChangedContents() OVERRIDE { }
virtual void respondToChangedSelection(SelectionType) OVERRIDE { }
virtual void respondToChangedSelection(LocalFrame*, SelectionType) OVERRIDE { }
virtual bool canCopyCut(LocalFrame*, bool defaultValue) const OVERRIDE { return defaultValue; }
virtual bool canPaste(LocalFrame*, bool defaultValue) const OVERRIDE { return defaultValue; }
......
......@@ -41,7 +41,7 @@ public:
virtual ~EditorClient() { }
virtual void respondToChangedContents() = 0;
virtual void respondToChangedSelection(SelectionType) = 0;
virtual void respondToChangedSelection(LocalFrame*, SelectionType) = 0;
virtual bool canCopyCut(LocalFrame*, bool defaultValue) const = 0;
virtual bool canPaste(LocalFrame*, bool defaultValue) const = 0;
......
......@@ -27,6 +27,7 @@
#include "config.h"
#include "EditorClientImpl.h"
#include "WebFrameClient.h"
#include "WebFrameImpl.h"
#include "WebPermissionClient.h"
#include "WebViewClient.h"
......@@ -46,10 +47,11 @@ EditorClientImpl::~EditorClientImpl()
{
}
void EditorClientImpl::respondToChangedSelection(WebCore::SelectionType selectionType)
void EditorClientImpl::respondToChangedSelection(LocalFrame* frame, WebCore::SelectionType selectionType)
{
if (m_webView->client())
m_webView->client()->didChangeSelection(selectionType != WebCore::RangeSelection);
WebFrameImpl* webFrame = WebFrameImpl::fromFrame(frame);
if (webFrame->client())
webFrame->client()->didChangeSelection(selectionType != WebCore::RangeSelection);
}
void EditorClientImpl::respondToChangedContents()
......
......@@ -49,7 +49,7 @@ public:
virtual ~EditorClientImpl();
virtual void respondToChangedContents() OVERRIDE;
virtual void respondToChangedSelection(WebCore::SelectionType) OVERRIDE;
virtual void respondToChangedSelection(WebCore::LocalFrame*, WebCore::SelectionType) OVERRIDE;
virtual bool canCopyCut(WebCore::LocalFrame*, bool defaultValue) const OVERRIDE;
virtual bool canPaste(WebCore::LocalFrame*, bool defaultValue) const OVERRIDE;
virtual void didExecuteCommand(String commandName) OVERRIDE;
......
......@@ -224,6 +224,12 @@ public:
// WARNING: This method may be called very frequently.
virtual void didUpdateCurrentHistoryItem(WebFrame*) { }
// Editing -------------------------------------------------------------
// These methods allow the client to intercept and overrule editing
// operations.
virtual void didChangeSelection(bool isSelectionEmpty) { }
// UI ------------------------------------------------------------------
......
......@@ -162,7 +162,6 @@ public:
// These methods allow the client to intercept and overrule editing
// operations.
virtual void didCancelCompositionOnSelectionChange() { }
virtual void didChangeSelection(bool isSelectionEmpty) { }
virtual void didChangeContents() { }
virtual void didExecuteCommand(const WebString& commandName) { }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment