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

Unified Diff: chrome/browser/sync/tools/sync_listen_notifications.cc

Issue 2824008: Command line flag cleanup. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: copyright years Created 10 years, 6 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 | « chrome/browser/chromeos/input_method/candidate_window.cc ('k') | chrome/browser/sync/tools/sync_tools.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/tools/sync_listen_notifications.cc
diff --git a/chrome/browser/sync/tools/sync_listen_notifications.cc b/chrome/browser/sync/tools/sync_listen_notifications.cc
index 2e762ac31d567cc2247f38dc7bc6ae0c226f8b29..5fa6759e580f8b3dc49c9dbbdafc9572716a55e5 100644
--- a/chrome/browser/sync/tools/sync_listen_notifications.cc
+++ b/chrome/browser/sync/tools/sync_listen_notifications.cc
@@ -18,6 +18,7 @@
#include "chrome/browser/sync/notifier/chrome_system_resources.h"
#include "chrome/browser/sync/notifier/invalidation_util.h"
#include "chrome/browser/sync/sync_constants.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/net/notifier/base/task_pump.h"
#include "chrome/common/net/notifier/communicator/xmpp_socket_adapter.h"
#include "chrome/common/net/notifier/listener/listen_task.h"
@@ -336,7 +337,7 @@ int main(int argc, char* argv[]) {
// Parse command line.
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- std::string email = command_line.GetSwitchValueASCII("email");
+ std::string email = command_line.GetSwitchValueASCII(switches::kSyncEmail);
if (email.empty()) {
printf("Usage: %s --email=foo@bar.com [--password=mypassword] "
"[--server=talk.google.com] [--port=5222] [--allow-plain] "
@@ -344,12 +345,15 @@ int main(int argc, char* argv[]) {
argv[0]);
return -1;
}
- std::string password = command_line.GetSwitchValueASCII("password");
- std::string server = command_line.GetSwitchValueASCII("server");
+ std::string password =
+ command_line.GetSwitchValueASCII(switches::kSyncPassword);
+ std::string server =
+ command_line.GetSwitchValueASCII(switches::kSyncServer);
if (server.empty()) {
server = "talk.google.com";
}
- std::string port_str = command_line.GetSwitchValueASCII("port");
+ std::string port_str =
+ command_line.GetSwitchValueASCII(switches::kSyncPort);
int port = 5222;
if (!port_str.empty()) {
int port_from_port_str = std::strtol(port_str.c_str(), NULL, 10);
@@ -359,11 +363,11 @@ int main(int argc, char* argv[]) {
port = port_from_port_str;
}
}
- bool allow_plain = command_line.HasSwitch("allow-plain");
- bool disable_tls = command_line.HasSwitch("disable-tls");
- bool use_ssl_tcp = command_line.HasSwitch("use-ssl-tcp");
+ bool allow_plain = command_line.HasSwitch(switches::kSyncAllowPlain);
+ bool disable_tls = command_line.HasSwitch(switches::kSyncDisableTls);
+ bool use_ssl_tcp = command_line.HasSwitch(switches::kSyncUseSslTcp);
if (use_ssl_tcp && (port != 443)) {
- LOG(WARNING) << "--use-ssl-tcp is set but port is " << port
+ LOG(WARNING) << switches::kSyncUseSslTcp << " is set but port is " << port
<< " instead of 443";
}
@@ -406,7 +410,7 @@ int main(int argc, char* argv[]) {
CacheInvalidationNotifierDelegate cache_invalidation_notifier_delegate(
&message_loop, data_types);
XmppNotificationClient::Delegate* delegate = NULL;
- if (command_line.HasSwitch("use-cache-invalidation")) {
+ if (command_line.HasSwitch(switches::kSyncUseCacheInvalidation)) {
delegate = &cache_invalidation_notifier_delegate;
} else {
delegate = &legacy_notifier_delegate;
« no previous file with comments | « chrome/browser/chromeos/input_method/candidate_window.cc ('k') | chrome/browser/sync/tools/sync_tools.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698