Check for error message from spelling service

When spelling service is not available, it returns HTTP status code 200, but the
JSON response data indicates an error. This CL checks for errors in the JSON
response data to correctly fallback on local spellcheck if needed.

BUG=230245

Review URL: https://chromiumcodereview.appspot.com/16050011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203466 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/spellchecker/spelling_service_client.h b/chrome/browser/spellchecker/spelling_service_client.h
index b0ee720..08ae2e95 100644
--- a/chrome/browser/spellchecker/spelling_service_client.h
+++ b/chrome/browser/spellchecker/spelling_service_client.h
@@ -87,6 +87,11 @@
   // Returns whether the specified service is available for the given profile.
   static bool IsAvailable(Profile* profile, ServiceType type);
 
+ protected:
+  // Parses a JSON-RPC response from the Spelling service.
+  bool ParseResponse(const std::string& data,
+                     std::vector<SpellCheckResult>* results);
+
  private:
   struct TextCheckCallbackData {
     TextCheckCallbackData(TextCheckCompleteCallback callback, string16 text);
@@ -108,10 +113,6 @@
   // requests to the Spelling service.
   virtual net::URLFetcher* CreateURLFetcher(const GURL& url);
 
-  // Parses a JSON-RPC response from the Spelling service.
-  bool ParseResponse(const std::string& data,
-                     std::vector<SpellCheckResult>* results);
-
   // The URLFetcher object used for sending a JSON-RPC request.
   std::map<const net::URLFetcher*, TextCheckCallbackData*> spellcheck_fetchers_;
 };