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

Unified Diff: chrome/browser/spellchecker/spelling_service_client.cc

Issue 10753023: Disable the spellcheck service when asynchronous spellchecking is disabled. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/spellchecker/spelling_service_client.cc
===================================================================
--- chrome/browser/spellchecker/spelling_service_client.cc (revision 145819)
+++ chrome/browser/spellchecker/spelling_service_client.cc (working copy)
@@ -4,6 +4,7 @@
#include "chrome/browser/spellchecker/spelling_service_client.h"
+#include "base/command_line.h"
#include "base/json/json_reader.h"
#include "base/json/string_escape.h"
#include "base/logging.h"
@@ -13,6 +14,7 @@
#include "base/values.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/spellcheck_result.h"
#include "content/public/browser/browser_thread.h"
@@ -118,6 +120,12 @@
!pref->GetBoolean(prefs::kSpellCheckUseSpellingService))
return false;
+ // The spellchecking service should be avilable only when asynchronous
+ // spellchecking is enabled because this service depends on it.
+ const CommandLine* command_line = CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kDisableAsynchronousSpellChecking))
+ return type == SUGGEST;
+
// Enable the suggest service only on languages not supported by the
// spellcheck service. When this client calls the spellcheck service, it
// returns not only spellcheck results but also spelling suggestions provided
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698