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

Unified Diff: third_party/WebKit/Source/web/TextCheckerClientImpl.cpp

Issue 2795113002: Move ownership of TextCheckerClientImpl to WebLocalFrameImpl (Closed)
Patch Set: Rebased Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/TextCheckerClientImpl.cpp
diff --git a/third_party/WebKit/Source/web/TextCheckerClientImpl.cpp b/third_party/WebKit/Source/web/TextCheckerClientImpl.cpp
index 6318c420e4cd26e8183e84b9dcd41409c7a2f419..7005a3d120604935117bb2087d506654febf8842 100644
--- a/third_party/WebKit/Source/web/TextCheckerClientImpl.cpp
+++ b/third_party/WebKit/Source/web/TextCheckerClientImpl.cpp
@@ -5,15 +5,23 @@
#include "web/TextCheckerClientImpl.h"
#include "public/web/WebTextCheckClient.h"
#include "public/web/WebTextCheckingResult.h"
+#include "web/WebLocalFrameImpl.h"
#include "web/WebTextCheckingCompletionImpl.h"
#include "web/WebViewImpl.h"
namespace blink {
-TextCheckerClientImpl::TextCheckerClientImpl(WebViewImpl* webView)
- : m_webView(webView) {}
+TextCheckerClientImpl::TextCheckerClientImpl(WebLocalFrameImpl* webLocalFrame)
+ : m_webLocalFrame(webLocalFrame) {}
-TextCheckerClientImpl::~TextCheckerClientImpl() = default;
+DEFINE_TRACE(TextCheckerClientImpl) {
+ visitor->trace(m_webLocalFrame);
+}
+
+WebTextCheckClient* TextCheckerClientImpl::webTextCheckClient() const {
+ // TODO(xiaochengh): Move WebTextCheckClient to WebLocalFrame.
+ return m_webLocalFrame->viewImpl()->textCheckClient();
+}
void TextCheckerClientImpl::checkSpellingOfString(const String& text,
int* misspellingLocation,
@@ -24,9 +32,9 @@ void TextCheckerClientImpl::checkSpellingOfString(const String& text,
int spellLength = 0;
// Check to see if the provided text is spelled correctly.
- if (m_webView->textCheckClient()) {
- m_webView->textCheckClient()->checkSpelling(text, spellLocation,
- spellLength, nullptr);
+ if (webTextCheckClient()) {
+ webTextCheckClient()->checkSpelling(text, spellLocation, spellLength,
+ nullptr);
} else {
spellLocation = 0;
spellLength = 0;
@@ -42,17 +50,17 @@ void TextCheckerClientImpl::checkSpellingOfString(const String& text,
void TextCheckerClientImpl::requestCheckingOfString(
TextCheckingRequest* request) {
- if (!m_webView->textCheckClient())
+ if (!webTextCheckClient())
return;
const String& text = request->data().text();
- m_webView->textCheckClient()->requestCheckingOfText(
+ webTextCheckClient()->requestCheckingOfText(
text, new WebTextCheckingCompletionImpl(request));
}
void TextCheckerClientImpl::cancelAllPendingRequests() {
- if (!m_webView->textCheckClient())
+ if (!webTextCheckClient())
return;
- m_webView->textCheckClient()->cancelAllPendingRequests();
+ webTextCheckClient()->cancelAllPendingRequests();
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/web/TextCheckerClientImpl.h ('k') | third_party/WebKit/Source/web/WebLocalFrameImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698