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

Side by Side 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 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/extensions/settings/settings_namespace.h"
6
7 #include "base/logging.h"
8
9 namespace extensions {
10
11 namespace settings_namespace {
12
13 namespace {
14 const char* kLocalNamespace = "local";
15 const char* kSyncNamespace = "sync";
16 } // namespace
17
18 std::string NamespaceToString(Namespace settings_namespace) {
19 switch (settings_namespace) {
20 case LOCAL: return kLocalNamespace;
21 case SYNC: return kSyncNamespace;
22 case INVALID:
23 default: NOTREACHED();
24 }
25 return std::string();
26 }
27
28 Namespace StringToNamespace(const std::string& namespace_string) {
29 if (namespace_string == kLocalNamespace)
30 return LOCAL;
31 else if (namespace_string == kSyncNamespace)
32 return SYNC;
33 return INVALID;
34 }
35
36 } // namespace settings_namespace
37
38 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698