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

Unified Diff: chrome/browser/extensions/settings/settings_namespace.cc

Issue 8670012: Extension Settings API: move the API functions into an object SettingsNamepace, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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: chrome/browser/extensions/settings/settings_namespace.cc
diff --git a/chrome/browser/extensions/settings/settings_namespace.cc b/chrome/browser/extensions/settings/settings_namespace.cc
new file mode 100644
index 0000000000000000000000000000000000000000..771c9911a2353c5372edf16c24511d23effdd45a
--- /dev/null
+++ b/chrome/browser/extensions/settings/settings_namespace.cc
@@ -0,0 +1,38 @@
+// Copyright (c) 2011 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/extensions/settings/settings_namespace.h"
+
+#include "base/logging.h"
+
+namespace extensions {
+
+namespace settings_namespace {
+
+namespace {
+const char* kLocalNamespace = "local";
+const char* kSyncNamespace = "sync";
+} // namespace
+
+std::string NamespaceToString(Namespace settings_namespace) {
+ switch (settings_namespace) {
+ case LOCAL: return kLocalNamespace;
+ case SYNC: return kSyncNamespace;
+ case INVALID:
+ default: NOTREACHED();
+ }
+ return std::string();
+}
+
+Namespace StringToNamespace(const std::string& namespace_string) {
+ if (namespace_string == kLocalNamespace)
+ return LOCAL;
+ else if (namespace_string == kSyncNamespace)
+ return SYNC;
+ return INVALID;
+}
+
+} // namespace settings_namespace
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698