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

Unified Diff: content/browser/speech/google_streaming_remote_engine.cc

Issue 189603005: Remove the --speech-service-key command line flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove GetAPIKey method Created 6 years, 9 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 | content/public/common/content_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/speech/google_streaming_remote_engine.cc
diff --git a/content/browser/speech/google_streaming_remote_engine.cc b/content/browser/speech/google_streaming_remote_engine.cc
index 89bfdcd13b98fbc134ff90a8fba6f739036bb3e4..88a461a41c71cada6bdba693d9c199d82bf6fb1d 100644
--- a/content/browser/speech/google_streaming_remote_engine.cc
+++ b/content/browser/speech/google_streaming_remote_engine.cc
@@ -7,7 +7,6 @@
#include <vector>
#include "base/bind.h"
-#include "base/command_line.h"
#include "base/rand_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
@@ -69,21 +68,6 @@ void DumpResponse(const std::string& response) {
}
}
-std::string GetAPIKey() {
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- if (command_line.HasSwitch(switches::kSpeechRecognitionWebserviceKey)) {
- DVLOG(1) << "GetAPIKey() used key from command-line.";
- return command_line.GetSwitchValueASCII(
- switches::kSpeechRecognitionWebserviceKey);
- }
-
- std::string api_key = google_apis::GetAPIKey();
- if (api_key.empty())
- DVLOG(1) << "GetAPIKey() returned empty string!";
-
- return api_key;
-}
-
} // namespace
const int GoogleStreamingRemoteEngine::kAudioPacketIntervalMs = 100;
@@ -317,7 +301,7 @@ GoogleStreamingRemoteEngine::ConnectBothStreams(const FSMEventArgs&) {
// Setup downstream fetcher.
std::vector<std::string> downstream_args;
downstream_args.push_back(
- "key=" + net::EscapeQueryParamValue(GetAPIKey(), true));
+ "key=" + net::EscapeQueryParamValue(google_apis::GetAPIKey(), true));
downstream_args.push_back("pair=" + request_key);
downstream_args.push_back("output=pb");
GURL downstream_url(std::string(kWebServiceBaseUrl) +
@@ -337,7 +321,7 @@ GoogleStreamingRemoteEngine::ConnectBothStreams(const FSMEventArgs&) {
// TODO(hans): Support for user-selected grammars.
std::vector<std::string> upstream_args;
upstream_args.push_back("key=" +
- net::EscapeQueryParamValue(GetAPIKey(), true));
+ net::EscapeQueryParamValue(google_apis::GetAPIKey(), true));
upstream_args.push_back("pair=" + request_key);
upstream_args.push_back("output=pb");
upstream_args.push_back(
« no previous file with comments | « no previous file | content/public/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698