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

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

Issue 10947042: Fixing spelling service to use GetAPIKey. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removing unnecessary line Created 8 years, 3 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
diff --git a/chrome/browser/spellchecker/spelling_service_client.cc b/chrome/browser/spellchecker/spelling_service_client.cc
index d14f48db03bfe6b9fa7ba8e963b7dae751a2eb01..2970d8f33d4c27f3b18286bcb75eb5fe4f397264 100644
--- a/chrome/browser/spellchecker/spelling_service_client.cc
+++ b/chrome/browser/spellchecker/spelling_service_client.cc
@@ -18,24 +18,12 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/spellcheck_result.h"
#include "content/public/browser/browser_thread.h"
+#include "google_apis/google_api_keys.h"
#include "net/base/load_flags.h"
#include "net/url_request/url_fetcher.h"
#include "unicode/uloc.h"
-#if defined(GOOGLE_CHROME_BUILD)
-#include "chrome/browser/spellchecker/internal/spellcheck_internal.h"
-#endif
-
-// Use the public URL to the Spelling service on Chromium. Unfortunately, this
-// service is an experimental service and returns an error without a key.
-#ifndef SPELLING_SERVICE_KEY_V1
-#define SPELLING_SERVICE_KEY_V1 ""
-#endif
-
-#ifndef SPELLING_SERVICE_KEY_V2
-#define SPELLING_SERVICE_KEY_V2 ""
-#endif
-
+// Use the public URL to the Spelling service on Chromium.
#ifndef SPELLING_SERVICE_URL
#define SPELLING_SERVICE_URL "https://www.googleapis.com/rpc"
#endif
@@ -88,17 +76,18 @@ bool SpellingServiceClient::RequestTextCheck(
"\"params\":{"
"\"text\":\"%s\","
"\"language\":\"%s\","
- "\"origin_country\":\"%s\","
+ "\"originCountry\":\"%s\","
"\"key\":\"%s\""
"}"
"}";
+ std::string api_key = google_apis::GetAPIKey();
std::string request = base::StringPrintf(
kSpellingRequest,
type,
encoded_text.c_str(),
language,
country,
- type == SUGGEST ? SPELLING_SERVICE_KEY_V1 : SPELLING_SERVICE_KEY_V2);
+ api_key.c_str());
groby-ooo-7-16 2012/09/19 23:06:05 Oh. Now I see it :)
static const char kSpellingServiceURL[] = SPELLING_SERVICE_URL;
GURL url = GURL(kSpellingServiceURL);
« 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