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

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

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.h
diff --git a/chrome/browser/extensions/settings/settings_namespace.h b/chrome/browser/extensions/settings/settings_namespace.h
new file mode 100644
index 0000000000000000000000000000000000000000..40d5801a9da40d366ac51f25c62e89231bf0ca4c
--- /dev/null
+++ b/chrome/browser/extensions/settings/settings_namespace.h
@@ -0,0 +1,34 @@
+// 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.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_NAMESPACE_H_
+#define CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_NAMESPACE_H_
+#pragma once
+
+#include <string>
+
+namespace extensions {
+
+namespace settings_namespace {
+
+// The namespaces of the storage areas.
+enum Namespace {
+ LOCAL, // "local" i.e. chrome.experimental.settings.local
+ SYNC, // "sync" i.e. chrome.experimental.settings.sync
+ INVALID
+};
+
+// Converts a namespace to its string representation.
+// Namespace must not be INVALID.
+std::string NamespaceToString(Namespace settings_namespace);
Matt Perry 2011/11/23 03:35:05 nit: I like ToString and FromString for these type
not at google - send to devlin 2011/11/23 11:04:52 Done.
+
+// Converts a string representation of a namespace to its namespace, or INVALID
+// if the string doesn't map to one.
+Namespace StringToNamespace(const std::string& ns_string);
+
+} // namespace settings_namespace
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_NAMESPACE_H_

Powered by Google App Engine
This is Rietveld 408576698