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

Unified Diff: chrome/renderer/spellchecker/spellcheck_provider.cc

Issue 11476005: [Spellcheck] Make sure context menu and actual spellcheck state are in sync. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes. Created 8 years 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
« no previous file with comments | « chrome/renderer/spellchecker/spellcheck_provider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/spellchecker/spellcheck_provider.cc
diff --git a/chrome/renderer/spellchecker/spellcheck_provider.cc b/chrome/renderer/spellchecker/spellcheck_provider.cc
index de268a9f43dfd142c74aea0124a0edb70bade447..e2bea06de836353859fb15d433ce9a57aa7ef4db 100644
--- a/chrome/renderer/spellchecker/spellcheck_provider.cc
+++ b/chrome/renderer/spellchecker/spellcheck_provider.cc
@@ -50,8 +50,10 @@ SpellCheckProvider::SpellCheckProvider(
spelling_panel_visible_(false),
spellcheck_(spellcheck) {
DCHECK(spellcheck_);
- if (render_view) // NULL in unit tests.
+ if (render_view) { // NULL in unit tests.
render_view->GetWebView()->setSpellCheckClient(this);
+ EnableSpellcheck(spellcheck_->is_spellcheck_enabled());
+ }
}
SpellCheckProvider::~SpellCheckProvider() {
@@ -111,7 +113,6 @@ bool SpellCheckProvider::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(SpellCheckMsg_RespondTextCheck, OnRespondTextCheck)
IPC_MESSAGE_HANDLER(SpellCheckMsg_ToggleSpellPanel, OnToggleSpellPanel)
#endif
- IPC_MESSAGE_HANDLER(SpellCheckMsg_ToggleSpellCheck, OnToggleSpellCheck)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -295,13 +296,12 @@ void SpellCheckProvider::OnToggleSpellPanel(bool is_currently_visible) {
}
#endif
-void SpellCheckProvider::OnToggleSpellCheck() {
+void SpellCheckProvider::EnableSpellcheck(bool enable) {
if (!render_view()->GetWebView())
return;
WebFrame* frame = render_view()->GetWebView()->focusedFrame();
- frame->enableContinuousSpellChecking(
- !frame->isContinuousSpellCheckingEnabled());
+ frame->enableContinuousSpellChecking(enable);
}
#if !defined(OS_MACOSX)
« no previous file with comments | « chrome/renderer/spellchecker/spellcheck_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698