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

Unified Diff: components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.cc

Issue 596053003: Add client type in chrome-proxy header for desktop. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@extension
Patch Set: Remove unnecessary const keyword. Created 6 years, 2 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
Index: components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.cc
diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.cc b/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.cc
index 676cbf58a8200ea1b9b34a4c51b8592e2c29e4de..a2e98c30660dfd438cafee9547b1fc2345913341 100644
--- a/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.cc
+++ b/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.cc
@@ -31,10 +31,16 @@ namespace data_reduction_proxy {
const char kAndroidWebViewProtocolVersion[] = "";
#endif
-// The clients supported by the data reduction proxy.
-const char kClientAndroidWebview[] = "webview";
-const char kClientChromeAndroid[] = "android";
-const char kClientChromeIOS[] = "ios";
+#define CLIENT_ENUM(name, str_value) \
+ case name: return str_value;
+const char* GetString(Client client) {
+ switch (client) {
+ CLIENT_ENUMS_LIST
+ }
+ NOTREACHED();
+ return "";
+}
+#undef CLIENT_ENUM
// static
bool DataReductionProxyAuthRequestHandler::IsKeySetOnCommandLine() {
@@ -44,10 +50,10 @@ bool DataReductionProxyAuthRequestHandler::IsKeySetOnCommandLine() {
}
DataReductionProxyAuthRequestHandler::DataReductionProxyAuthRequestHandler(
- const std::string& client,
+ Client client,
DataReductionProxyParams* params,
scoped_refptr<base::SingleThreadTaskRunner> network_task_runner)
- : client_(client),
+ : client_(GetString(client)),
data_reduction_proxy_params_(params),
network_task_runner_(network_task_runner) {
GetChromiumBuildAndPatch(ChromiumVersion(), &build_number_, &patch_number_);
@@ -55,11 +61,11 @@ DataReductionProxyAuthRequestHandler::DataReductionProxyAuthRequestHandler(
}
DataReductionProxyAuthRequestHandler::DataReductionProxyAuthRequestHandler(
- const std::string& client,
+ Client client,
const std::string& version,
DataReductionProxyParams* params,
scoped_refptr<base::SingleThreadTaskRunner> network_task_runner)
- : client_(client),
+ : client_(GetString(client)),
data_reduction_proxy_params_(params),
network_task_runner_(network_task_runner) {
GetChromiumBuildAndPatch(version, &build_number_, &patch_number_);

Powered by Google App Engine
This is Rietveld 408576698