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

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

Issue 6873014: Clear RenderThread of any Chrome specific code, and move a bunch of stuff out of RenderView. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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
« no previous file with comments | « chrome/renderer/spellchecker/spellcheck_provider.h ('k') | content/browser/plugin_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/spellchecker/spellcheck_provider.cc
===================================================================
--- chrome/renderer/spellchecker/spellcheck_provider.cc (revision 81801)
+++ chrome/renderer/spellchecker/spellcheck_provider.cc (working copy)
@@ -6,6 +6,8 @@
#include "base/command_line.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/render_view_commands.h"
+#include "chrome/common/render_messages.h"
#include "chrome/common/spellcheck_messages.h"
#include "chrome/renderer/spellchecker/spellcheck.h"
#include "content/renderer/render_view.h"
@@ -78,6 +80,27 @@
return handled;
}
+void SpellCheckProvider::FocusedNodeChanged(const WebKit::WebNode& unused) {
+ bool is_enabled = false;
+ WebKit::WebNode node = render_view()->GetFocusedNode();
+ if (!node.isNull())
+ is_enabled = render_view()->IsEditableNode(node);
+
+ RenderViewCommandCheckedState checked_state =
+ RENDER_VIEW_COMMAND_CHECKED_STATE_UNCHECKED;
+ if (is_enabled && render_view()->webview()) {
+ WebFrame* frame = render_view()->webview()->focusedFrame();
+ if (frame->isContinuousSpellCheckingEnabled())
+ checked_state = RENDER_VIEW_COMMAND_CHECKED_STATE_CHECKED;
+ }
+
+ Send(new ViewHostMsg_CommandStateChanged(
+ routing_id(),
+ RENDER_VIEW_COMMAND_TOGGLE_SPELL_CHECK,
+ is_enabled,
+ checked_state));
+}
+
void SpellCheckProvider::spellCheck(
const WebString& text,
int& offset,
« no previous file with comments | « chrome/renderer/spellchecker/spellcheck_provider.h ('k') | content/browser/plugin_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698