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

Side by Side Diff: chrome/browser/resource_message_filter.cc

Issue 13731: [chromium-reviews] Add "Enable spell check for this field" menu option in sub context menu for c... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/resource_message_filter.h" 5 #include "chrome/browser/resource_message_filter.h"
6 6
7 #include "base/clipboard.h" 7 #include "base/clipboard.h"
8 #include "base/histogram.h" 8 #include "base/histogram.h"
9 #include "base/thread.h" 9 #include "base/thread.h"
10 #include "chrome/browser/chrome_plugin_browsing_context.h" 10 #include "chrome/browser/chrome_plugin_browsing_context.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 190
191 void ResourceMessageFilter::OnReceiveContextMenuMsg(const IPC::Message& msg) { 191 void ResourceMessageFilter::OnReceiveContextMenuMsg(const IPC::Message& msg) {
192 void* iter = NULL; 192 void* iter = NULL;
193 ViewHostMsg_ContextMenu_Params params; 193 ViewHostMsg_ContextMenu_Params params;
194 if (!IPC::ParamTraits<ViewHostMsg_ContextMenu_Params>:: 194 if (!IPC::ParamTraits<ViewHostMsg_ContextMenu_Params>::
195 Read(&msg, &iter, &params)) 195 Read(&msg, &iter, &params))
196 return; 196 return;
197 197
198 // Fill in the dictionary suggestions if required. 198 // Fill in the dictionary suggestions if required.
199 if (!params.misspelled_word.empty() && 199 if (!params.misspelled_word.empty() &&
200 spellchecker_ != NULL) { 200 spellchecker_ != NULL && params.spellcheck_enabled) {
201 int misspell_location, misspell_length; 201 int misspell_location, misspell_length;
202 bool is_misspelled = !spellchecker_->SpellCheckWord( 202 bool is_misspelled = !spellchecker_->SpellCheckWord(
203 params.misspelled_word.c_str(), 203 params.misspelled_word.c_str(),
204 static_cast<int>(params.misspelled_word.length()), 204 static_cast<int>(params.misspelled_word.length()),
205 &misspell_location, &misspell_length, 205 &misspell_location, &misspell_length,
206 &params.dictionary_suggestions); 206 &params.dictionary_suggestions);
207 207
208 // If not misspelled, make the misspelled_word param empty. 208 // If not misspelled, make the misspelled_word param empty.
209 if (!is_misspelled) 209 if (!is_misspelled)
210 params.misspelled_word.clear(); 210 params.misspelled_word.clear();
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 if (type == NOTIFY_SPELLCHECKER_REINITIALIZED) { 651 if (type == NOTIFY_SPELLCHECKER_REINITIALIZED) {
652 spellchecker_ = Details<SpellcheckerReinitializedDetails> 652 spellchecker_ = Details<SpellcheckerReinitializedDetails>
653 (details).ptr()->spellchecker; 653 (details).ptr()->spellchecker;
654 } 654 }
655 } 655 }
656 656
657 void ResourceMessageFilter::OnDnsPrefetch( 657 void ResourceMessageFilter::OnDnsPrefetch(
658 const std::vector<std::string>& hostnames) { 658 const std::vector<std::string>& hostnames) {
659 chrome_browser_net::DnsPrefetchList(hostnames); 659 chrome_browser_net::DnsPrefetchList(hostnames);
660 } 660 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698