Chromium Code Reviews| Index: chrome/renderer/spellchecker/spellcheck_provider.cc |
| diff --git a/chrome/renderer/spellchecker/spellcheck_provider.cc b/chrome/renderer/spellchecker/spellcheck_provider.cc |
| index 5afa759ab0294426830951448e60ed19fb6828bb..b348fd9ecddd358288389feedc0020bf014a1bba 100644 |
| --- a/chrome/renderer/spellchecker/spellcheck_provider.cc |
| +++ b/chrome/renderer/spellchecker/spellcheck_provider.cc |
| @@ -16,14 +16,14 @@ |
| #include "third_party/WebKit/public/platform/WebVector.h" |
| #include "third_party/WebKit/public/web/WebDocument.h" |
| #include "third_party/WebKit/public/web/WebElement.h" |
| -#include "third_party/WebKit/public/web/WebFrame.h" |
| +#include "third_party/WebKit/public/web/WebLocalFrame.h" |
| #include "third_party/WebKit/public/web/WebTextCheckingCompletion.h" |
| #include "third_party/WebKit/public/web/WebTextCheckingResult.h" |
| #include "third_party/WebKit/public/web/WebTextDecorationType.h" |
| #include "third_party/WebKit/public/web/WebView.h" |
| using blink::WebElement; |
| -using blink::WebFrame; |
| +using blink::WebLocalFrame; |
| using blink::WebString; |
| using blink::WebTextCheckingCompletion; |
| using blink::WebTextCheckingResult; |
| @@ -112,7 +112,7 @@ bool SpellCheckProvider::OnMessageReceived(const IPC::Message& message) { |
| void SpellCheckProvider::FocusedNodeChanged(const blink::WebNode& unused) { |
| #if defined(USE_BROWSER_SPELLCHECKER) |
| - WebFrame* frame = render_view()->GetWebView()->focusedFrame(); |
| + WebLocalFrame* frame = render_view()->GetWebView()->focusedFrame(); |
| WebElement element = frame->document().isNull() ? WebElement() : |
| frame->document().focusedElement(); |
| bool enabled = !element.isNull() && element.isEditable(); |
| @@ -290,7 +290,10 @@ void SpellCheckProvider::EnableSpellcheck(bool enable) { |
| if (!render_view()->GetWebView()) |
| return; |
| - WebFrame* frame = render_view()->GetWebView()->focusedFrame(); |
| + WebLocalFrame* frame = render_view()->GetWebView()->focusedFrame(); |
| + if (!frame) |
|
dcheng
2016/06/13 17:29:45
This seems like the code is doing the wrong thing:
yabinh
2016/06/16 07:12:57
Most of the null checks is unnecessary, except for
|
| + return; |
| + |
| frame->enableContinuousSpellChecking(enable); |
| if (!enable) |
| frame->removeSpellingMarkers(); |