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
diff --git a/chrome/browser/spellchecker/spelling_service_client.h b/chrome/browser/spellchecker/spelling_service_client.h
index ac129270..3a80fc8e 100644
--- a/chrome/browser/spellchecker/spelling_service_client.h
+++ b/chrome/browser/spellchecker/spelling_service_client.h
@@ -50,6 +50,16 @@
//
class SpellingServiceClient : public content::URLFetcherDelegate {
public:
+ // Service types provided by the Spelling service. The Spelling service
+ // consists of a couple of backends:
+ // * SUGGEST: Retrieving suggestions for a word (used by Google Search), and;
+ // * SPELLCHECK: Spellchecking text (used by Google Docs).
+ // This type is used for choosing a backend when sending a JSON-RPC request to
+ // the service.
+ enum ServiceType {
+ SUGGEST = 1,
+ SPELLCHECK = 2,
+ };
typedef base::Callback<void(
int /* tag */,
const std::vector<SpellCheckResult>& /* results */)>
@@ -67,6 +77,7 @@
// call |callback| when we receive a text-check response from the service.
bool RequestTextCheck(Profile* profile,
int tag,
+ ServiceType type,
const string16& text,
const TextCheckCompleteCallback& callback);