summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/tools
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-10 01:13:11 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-10 01:13:11 +0000
commit2145dc054c4d39adce5d4dee271a7d980a5ace09 (patch)
tree33450b42b0203f74a800c001595de25d6e722d05 /chrome/browser/sync/tools
parent65e1a58d4ad1b496bc11d5fd9db2d338725a9990 (diff)
downloadchromium_src-2145dc054c4d39adce5d4dee271a7d980a5ace09.zip
chromium_src-2145dc054c4d39adce5d4dee271a7d980a5ace09.tar.gz
chromium_src-2145dc054c4d39adce5d4dee271a7d980a5ace09.tar.bz2
sync: Store hard coded constants into its header file.
(Note: This was a TODO for akalin). BUG=None TEST=trybots, and manually Review URL: http://codereview.chromium.org/2704002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49353 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/tools')
-rw-r--r--chrome/browser/sync/tools/sync_constants.cc14
-rw-r--r--chrome/browser/sync/tools/sync_constants.h17
-rw-r--r--chrome/browser/sync/tools/sync_listen_notifications.cc11
-rw-r--r--chrome/browser/sync/tools/sync_tools.gyp2
4 files changed, 38 insertions, 6 deletions
diff --git a/chrome/browser/sync/tools/sync_constants.cc b/chrome/browser/sync/tools/sync_constants.cc
new file mode 100644
index 0000000..bf9c0d1
--- /dev/null
+++ b/chrome/browser/sync/tools/sync_constants.cc
@@ -0,0 +1,14 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/sync/tools/sync_constants.h"
+
+namespace sync_tools {
+
+const char kAutoFillType[] = "AUTOFILL";
+const char kBookmarkType[] = "BOOKMARK";
+const char kPreferenceType[] = "PREFERENCE";
+const char kThemeType[] = "THEME";
+
+} // namespace sync_tools
diff --git a/chrome/browser/sync/tools/sync_constants.h b/chrome/browser/sync/tools/sync_constants.h
new file mode 100644
index 0000000..a80cc3d
--- /dev/null
+++ b/chrome/browser/sync/tools/sync_constants.h
@@ -0,0 +1,17 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_SYNC_TOOLS_SYNC_CONSTANTS_H_
+#define CHROME_BROWSER_SYNC_TOOLS_SYNC_CONSTANTS_H_
+
+namespace sync_tools {
+
+extern const char kAutoFillType[];
+extern const char kBookmarkType[];
+extern const char kPreferenceType[];
+extern const char kThemeType[];
+
+} // namespace sync_tools
+
+#endif // CHROME_BROWSER_SYNC_TOOLS_SYNC_CONSTANTS_H_
diff --git a/chrome/browser/sync/tools/sync_listen_notifications.cc b/chrome/browser/sync/tools/sync_listen_notifications.cc
index 899798ef..4adf374 100644
--- a/chrome/browser/sync/tools/sync_listen_notifications.cc
+++ b/chrome/browser/sync/tools/sync_listen_notifications.cc
@@ -17,6 +17,7 @@
#include "base/task.h"
#include "chrome/browser/sync/notification_method.h"
#include "chrome/browser/sync/sync_constants.h"
+#include "chrome/browser/sync/tools/sync_constants.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"
@@ -753,13 +754,11 @@ int main(int argc, char* argv[]) {
MessageLoopForIO message_loop;
// TODO(akalin): Make this configurable.
- // TODO(akalin): Store these constants in a header somewhere (maybe
- // browser/sync/protocol).
std::vector<std::string> data_types;
- data_types.push_back("AUTOFILL");
- data_types.push_back("BOOKMARK");
- data_types.push_back("THEME");
- data_types.push_back("PREFERENCE");
+ data_types.push_back(sync_tools::kAutoFillType);
+ data_types.push_back(sync_tools::kBookmarkType);
+ data_types.push_back(sync_tools::kThemeType);
+ data_types.push_back(sync_tools::kPreferenceType);
// Connect and listen.
LegacyNotifierDelegate legacy_notifier_delegate;
diff --git a/chrome/browser/sync/tools/sync_tools.gyp b/chrome/browser/sync/tools/sync_tools.gyp
index 792bfbe..8f9c3a8 100644
--- a/chrome/browser/sync/tools/sync_tools.gyp
+++ b/chrome/browser/sync/tools/sync_tools.gyp
@@ -11,6 +11,8 @@
'target_name': 'sync_listen_notifications',
'type': 'executable',
'sources': [
+ 'sync_constants.cc',
+ 'sync_constants.h',
'sync_listen_notifications.cc',
# We are directly including the sync_constants.cc and h files to avoid
# pulling in browser.lib.