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

Unified Diff: cloud_print/gcp20/prototype/command_line_reader.cc

Issue 587103002: GCP 2.0 prototype switches code cleanup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sun Sep 21 21:20:21 PDT 2014 Created 6 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 | cloud_print/gcp20/prototype/dns_sd_server.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cloud_print/gcp20/prototype/command_line_reader.cc
diff --git a/cloud_print/gcp20/prototype/command_line_reader.cc b/cloud_print/gcp20/prototype/command_line_reader.cc
index 2d9b51ec1b6dc53142e4916441d5dabc8843e1a0..ecab5797d40589a89d5430dd787b26adbef386ae 100644
--- a/cloud_print/gcp20/prototype/command_line_reader.cc
+++ b/cloud_print/gcp20/prototype/command_line_reader.cc
@@ -7,20 +7,16 @@
#include "base/command_line.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
+#include "cloud_print/gcp20/prototype/gcp20_switches.h"
namespace command_line_reader {
-const char kHttpPortSwitch[] = "http-port";
-const char kTtlSwitch[] = "ttl";
-const char kServiceNameSwitch[] = "service-name";
-const char kDomainNameSwitch[] = "domain-name";
-const char kStatePathSwitch[] = "state-path";
-
uint16 ReadHttpPort(uint16 default_value) {
uint32 http_port = 0;
std::string http_port_string =
- CommandLine::ForCurrentProcess()->GetSwitchValueASCII(kHttpPortSwitch);
+ CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kHttpPort);
if (!base::StringToUint(http_port_string, &http_port))
http_port = default_value;
@@ -38,8 +34,8 @@ uint32 ReadTtl(uint32 default_value) {
uint32 ttl = 0;
if (!base::StringToUint(
- CommandLine::ForCurrentProcess()->GetSwitchValueASCII(kTtlSwitch),
- &ttl)) {
+ CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kTtl),
+ &ttl)) {
ttl = default_value;
}
@@ -49,14 +45,16 @@ uint32 ReadTtl(uint32 default_value) {
std::string ReadServiceNamePrefix(const std::string& default_value) {
std::string service_name =
- CommandLine::ForCurrentProcess()->GetSwitchValueASCII(kServiceNameSwitch);
+ CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kServiceName);
return service_name.empty() ? default_value : service_name;
}
std::string ReadDomainName(const std::string& default_value) {
std::string domain_name =
- CommandLine::ForCurrentProcess()->GetSwitchValueASCII(kDomainNameSwitch);
+ CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kDomainName);
if (domain_name.empty())
return default_value;
@@ -77,8 +75,8 @@ std::string ReadDomainName(const std::string& default_value) {
}
std::string ReadStatePath(const std::string& default_value) {
- std::string filename =
- CommandLine::ForCurrentProcess()->GetSwitchValueASCII(kStatePathSwitch);
+ std::string filename = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kStatePath);
if (filename.empty())
return default_value;
« no previous file with comments | « no previous file | cloud_print/gcp20/prototype/dns_sd_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698