| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_API_SETTINGS_PRIVATE_PREFS_UTIL_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_PREFS_UTIL_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_PREFS_UTIL_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_PREFS_UTIL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 public: | 23 public: |
| 24 // Success or error statuses from calling SetPref. | 24 // Success or error statuses from calling SetPref. |
| 25 enum SetPrefResult { | 25 enum SetPrefResult { |
| 26 SUCCESS, | 26 SUCCESS, |
| 27 PREF_NOT_MODIFIABLE, | 27 PREF_NOT_MODIFIABLE, |
| 28 PREF_NOT_FOUND, | 28 PREF_NOT_FOUND, |
| 29 PREF_TYPE_MISMATCH, | 29 PREF_TYPE_MISMATCH, |
| 30 PREF_TYPE_UNSUPPORTED | 30 PREF_TYPE_UNSUPPORTED |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 // TODO(dbeam): why is the key a std::string rather than const char*? |
| 33 using TypedPrefMap = std::map<std::string, api::settings_private::PrefType>; | 34 using TypedPrefMap = std::map<std::string, api::settings_private::PrefType>; |
| 34 | 35 |
| 35 explicit PrefsUtil(Profile* profile); | 36 explicit PrefsUtil(Profile* profile); |
| 36 virtual ~PrefsUtil(); | 37 virtual ~PrefsUtil(); |
| 37 | 38 |
| 38 // Gets the list of whitelisted pref keys -- that is, those which correspond | 39 // Gets the list of whitelisted pref keys -- that is, those which correspond |
| 39 // to prefs that clients of the settingsPrivate API may retrieve and | 40 // to prefs that clients of the settingsPrivate API may retrieve and |
| 40 // manipulate. | 41 // manipulate. |
| 41 const TypedPrefMap& GetWhitelistedKeys(); | 42 const TypedPrefMap& GetWhitelistedKeys(); |
| 42 | 43 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 101 |
| 101 SetPrefResult SetCrosSettingsPref(const std::string& name, | 102 SetPrefResult SetCrosSettingsPref(const std::string& name, |
| 102 const base::Value* value); | 103 const base::Value* value); |
| 103 | 104 |
| 104 Profile* profile_; // weak | 105 Profile* profile_; // weak |
| 105 }; | 106 }; |
| 106 | 107 |
| 107 } // namespace extensions | 108 } // namespace extensions |
| 108 | 109 |
| 109 #endif // CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_PREFS_UTIL_H_ | 110 #endif // CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_PREFS_UTIL_H_ |
| OLD | NEW |