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

Unified Diff: chrome/renderer/render_view.cc

Issue 6326011: Revert 72570 - Mac: Enable "Check Spelling While Typing" in Edit menu... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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/render_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_view.cc
===================================================================
--- chrome/renderer/render_view.cc (revision 72570)
+++ chrome/renderer/render_view.cc (working copy)
@@ -39,7 +39,6 @@
#include "chrome/common/pepper_messages.h"
#include "chrome/common/pepper_plugin_registry.h"
#include "chrome/common/render_messages.h"
-#include "chrome/common/render_view_commands.h"
#include "chrome/common/renderer_preferences.h"
#include "chrome/common/thumbnail_score.h"
#include "chrome/common/url_constants.h"
@@ -1627,12 +1626,18 @@
}
void RenderView::OnScrollFocusedEditableNodeIntoView() {
- WebKit::WebNode node = GetFocusedNode();
- if (!node.isNull()) {
- if (IsEditableNode(node))
- // TODO(varunjain): Change webkit API to scroll a particular node into
- // view and use that API here instead.
- webview()->scrollFocusedNodeIntoView();
+ if (!webview())
+ return;
+ WebFrame* focused_frame = webview()->focusedFrame();
+ if (focused_frame) {
+ WebDocument doc = focused_frame->document();
+ if (!doc.isNull()) {
+ WebNode node = doc.focusedNode();
+ if (IsEditableNode(node))
+ // TODO(varunjain): Change webkit API to scroll a particular node into
+ // view and use that API here instead.
+ webview()->scrollFocusedNodeIntoView();
+ }
}
}
@@ -2363,10 +2368,6 @@
word));
}
-void RenderView::continuousSpellCheckingEnabledStateChanged() {
- UpdateToggleSpellCheckCommandState();
-}
-
bool RenderView::runFileChooser(
const WebKit::WebFileChooserParams& params,
WebFileChooserCompletion* chooser_completion) {
@@ -2493,27 +2494,6 @@
}
}
-void RenderView::UpdateToggleSpellCheckCommandState() {
- bool is_enabled = false;
- WebKit::WebNode node = GetFocusedNode();
- if (!node.isNull())
- is_enabled = IsEditableNode(node);
-
- RenderViewCommandCheckedState checked_state =
- RENDER_VIEW_COMMAND_CHECKED_STATE_UNCHECKED;
- if (is_enabled && webview()) {
- WebFrame* frame = 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 RenderView::StartNavStateSyncTimerIfNecessary() {
int delay;
if (send_content_state_immediately_)
@@ -2590,8 +2570,6 @@
webview()->accessibilityObject(),
WebKit::WebAccessibilityNotificationFocusedUIElementChanged);
}
-
- UpdateToggleSpellCheckCommandState();
}
void RenderView::navigateBackForwardSoon(int offset) {
@@ -4547,19 +4525,6 @@
return frame;
}
-WebNode RenderView::GetFocusedNode() const {
- if (!webview())
- return WebNode();
- WebFrame* focused_frame = webview()->focusedFrame();
- if (focused_frame) {
- WebDocument doc = focused_frame->document();
- if (!doc.isNull())
- return doc.focusedNode();
- }
-
- return WebNode();
-}
-
void RenderView::SetSuggestions(const std::vector<std::string>& suggestions) {
// Explicitly allow empty vector to be sent to the browser.
Send(new ViewHostMsg_SetSuggestions(routing_id_, page_id_, suggestions));
« no previous file with comments | « chrome/renderer/render_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698