diff options
author | sail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-03 18:58:30 +0000 |
---|---|---|
committer | sail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-03 18:58:30 +0000 |
commit | 90f4fe96fa29377529a67f017dddba71748fd9f6 (patch) | |
tree | 93c4e4f6a38f0ee00f6ab4dc7fddf95cab1692de /chrome/browser/renderer_host/render_view_host.cc | |
parent | de41fbf33b50d8aabcfeafe61b748a9eba34c3e3 (diff) | |
download | chromium_src-90f4fe96fa29377529a67f017dddba71748fd9f6.zip chromium_src-90f4fe96fa29377529a67f017dddba71748fd9f6.tar.gz chromium_src-90f4fe96fa29377529a67f017dddba71748fd9f6.tar.bz2 |
Revert 73641 - Mac: Enable "Check Spelling While Typing" in Edit menu
Currently the "Edit -> Spelling and Grammar -> Check Spelling While Typing" menu item is always disabled.
The problem is that the logic to enable / disable this item lives in the render process and not in the UI.
This patch implements a generic message that the render process can send to the browser to update the state of view commands. This is used to enable and disable the "Check Spelling While Typing" menu item.
BUG=38440
TEST=Clicked in an edit box and verified that the "Check Spelling While Typing" menu item was enabled. Verified that changing the value from the context menu correctly updates the Edit menu as well.
TBR=sail@chromium.org
Review URL: http://codereview.chromium.org/6410062
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73642 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host/render_view_host.cc')
-rw-r--r-- | chrome/browser/renderer_host/render_view_host.cc | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index 3749f12..3c84f8c 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -44,7 +44,6 @@ #include "chrome/common/notification_type.h" #include "chrome/common/render_messages.h" #include "chrome/common/render_messages_params.h" -#include "chrome/common/render_view_commands.h" #include "chrome/common/result_codes.h" #include "chrome/common/thumbnail_score.h" #include "chrome/common/translate_errors.h" @@ -341,22 +340,6 @@ int RenderViewHost::GetPendingRequestId() { return pending_request_id_; } -RenderViewHost::CommandState RenderViewHost::GetStateForCommand( - RenderViewCommand command) const { - if (command != RENDER_VIEW_COMMAND_TOGGLE_SPELL_CHECK) - LOG(DFATAL) << "Unknown command " << command; - - std::map<RenderViewCommand, CommandState>::const_iterator it = - command_states_.find(command); - if (it == command_states_.end()) { - CommandState state; - state.is_enabled = false; - state.checked_state = RENDER_VIEW_COMMAND_CHECKED_STATE_UNCHECKED; - return state; - } - return it->second; -} - void RenderViewHost::Stop() { Send(new ViewMsg_Stop(routing_id())); } @@ -823,8 +806,6 @@ bool RenderViewHost::OnMessageReceived(const IPC::Message& msg) { #endif IPC_MESSAGE_HANDLER(ViewHostMsg_PagesReadyForPreview, OnPagesReadyForPreview) - IPC_MESSAGE_HANDLER(ViewHostMsg_CommandStateChanged, - OnCommandStateChanged) // Have the super handle all other messages. IPC_MESSAGE_UNHANDLED(handled = RenderWidgetHost::OnMessageReceived(msg)) IPC_END_MESSAGE_MAP_EX() @@ -1757,25 +1738,3 @@ void RenderViewHost::OnPagesReadyForPreview( // Send the printingDone msg for now. Send(new ViewMsg_PrintingDone(routing_id(), params.document_cookie, true)); } - -void RenderViewHost::OnCommandStateChanged(int command, - bool is_enabled, - int checked_state) { - if (command != RENDER_VIEW_COMMAND_TOGGLE_SPELL_CHECK) { - LOG(DFATAL) << "Unknown command " << command; - return; - } - - if (checked_state != RENDER_VIEW_COMMAND_CHECKED_STATE_UNCHECKED && - checked_state != RENDER_VIEW_COMMAND_CHECKED_STATE_CHECKED && - checked_state != RENDER_VIEW_COMMAND_CHECKED_STATE_MIXED) { - LOG(DFATAL) << "Invalid checked state " << checked_state; - return; - } - - CommandState state; - state.is_enabled = is_enabled; - state.checked_state = - static_cast<RenderViewCommandCheckedState>(checked_state); - command_states_[static_cast<RenderViewCommand>(command)] = state; -} |