OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_NAMESPACE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_NAMESPACE_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_NAMESPACE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_NAMESPACE_H_ |
7 #pragma once | |
8 | 7 |
9 #include <string> | 8 #include <string> |
10 | 9 |
11 namespace extensions { | 10 namespace extensions { |
12 | 11 |
13 namespace settings_namespace { | 12 namespace settings_namespace { |
14 | 13 |
15 // The namespaces of the storage areas. | 14 // The namespaces of the storage areas. |
16 enum Namespace { | 15 enum Namespace { |
17 LOCAL, // "local" i.e. chrome.storage.local | 16 LOCAL, // "local" i.e. chrome.storage.local |
18 SYNC, // "sync" i.e. chrome.storage.sync | 17 SYNC, // "sync" i.e. chrome.storage.sync |
19 INVALID | 18 INVALID |
20 }; | 19 }; |
21 | 20 |
22 // Converts a namespace to its string representation. | 21 // Converts a namespace to its string representation. |
23 // Namespace must not be INVALID. | 22 // Namespace must not be INVALID. |
24 std::string ToString(Namespace settings_namespace); | 23 std::string ToString(Namespace settings_namespace); |
25 | 24 |
26 // Converts a string representation of a namespace to its namespace, or INVALID | 25 // Converts a string representation of a namespace to its namespace, or INVALID |
27 // if the string doesn't map to one. | 26 // if the string doesn't map to one. |
28 Namespace FromString(const std::string& ns_string); | 27 Namespace FromString(const std::string& ns_string); |
29 | 28 |
30 } // namespace settings_namespace | 29 } // namespace settings_namespace |
31 | 30 |
32 } // namespace extensions | 31 } // namespace extensions |
33 | 32 |
34 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_NAMESPACE_H_ | 33 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_NAMESPACE_H_ |
OLD | NEW |