summaryrefslogtreecommitdiffstats
path: root/chrome/browser/spellchecker/spelling_service_client.cc
diff options
context:
space:
mode:
authorhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-07 01:40:41 +0000
committerhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-07 01:40:41 +0000
commit182bdf03f70cd5c6affad99fea8c0c883a6f775a (patch)
tree332b5b39cc8fc382ed3df50ecb6b56afb0d65823 /chrome/browser/spellchecker/spelling_service_client.cc
parent98722be5fc6d0e65e216d2e72f9b9d54e7c7f095 (diff)
downloadchromium_src-182bdf03f70cd5c6affad99fea8c0c883a6f775a.zip
chromium_src-182bdf03f70cd5c6affad99fea8c0c883a6f775a.tar.gz
chromium_src-182bdf03f70cd5c6affad99fea8c0c883a6f775a.tar.bz2
Add a 'version' parameter to SpellingServiceClient::RequestTextCheck().
This change adds a version parameter used by the JSON-RPC call. When Chrome uses the Spelling service for retriving suggestions, Chrome sets its version number to 1. On the other hand, when Chrome uses this Spelling service for checking text, Chrome sets its version number to 2. BUG=107371 TEST=manual Review URL: http://codereview.chromium.org/10012031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131229 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/spellchecker/spelling_service_client.cc')
-rw-r--r--chrome/browser/spellchecker/spelling_service_client.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/chrome/browser/spellchecker/spelling_service_client.cc b/chrome/browser/spellchecker/spelling_service_client.cc
index b34ce54..85bbc47 100644
--- a/chrome/browser/spellchecker/spelling_service_client.cc
+++ b/chrome/browser/spellchecker/spelling_service_client.cc
@@ -42,8 +42,10 @@ SpellingServiceClient::~SpellingServiceClient() {
bool SpellingServiceClient::RequestTextCheck(
Profile* profile,
int tag,
+ ServiceType type,
const string16& text,
const TextCheckCompleteCallback& callback) {
+ DCHECK(type == SUGGEST || type == SPELLCHECK);
net::URLRequestContextGetter* context = profile->GetRequestContext();
if (!context)
return false;
@@ -76,7 +78,7 @@ bool SpellingServiceClient::RequestTextCheck(
static const char kSpellingRequest[] =
"{"
"\"method\":\"spelling.check\","
- "\"apiVersion\":\"v1\","
+ "\"apiVersion\":\"v%d\","
"\"params\":{"
"\"text\":\"%s\","
"\"language\":\"%s\","
@@ -85,6 +87,7 @@ bool SpellingServiceClient::RequestTextCheck(
"}"
"}";
std::string request = base::StringPrintf(kSpellingRequest,
+ type,
encoded_text.c_str(),
language, country);