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 <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "chrome/common/extensions/api/settings_private.h" | 14 #include "chrome/common/extensions/api/settings_private.h" |
15 | 15 |
16 class PrefService; | 16 class PrefService; |
17 class Profile; | 17 class Profile; |
18 | 18 |
19 namespace extensions { | 19 namespace extensions { |
| 20 class Extension; |
20 | 21 |
21 class PrefsUtil { | 22 class PrefsUtil { |
22 | 23 |
23 public: | 24 public: |
24 // Success or error statuses from calling SetPref. | 25 // Success or error statuses from calling SetPref. |
25 enum SetPrefResult { | 26 enum SetPrefResult { |
26 SUCCESS, | 27 SUCCESS, |
27 PREF_NOT_MODIFIABLE, | 28 PREF_NOT_MODIFIABLE, |
28 PREF_NOT_FOUND, | 29 PREF_NOT_FOUND, |
29 PREF_TYPE_MISMATCH, | 30 PREF_TYPE_MISMATCH, |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 96 |
96 api::settings_private::PrefType GetType(const std::string& name, | 97 api::settings_private::PrefType GetType(const std::string& name, |
97 base::Value::Type type); | 98 base::Value::Type type); |
98 | 99 |
99 std::unique_ptr<api::settings_private::PrefObject> GetCrosSettingsPref( | 100 std::unique_ptr<api::settings_private::PrefObject> GetCrosSettingsPref( |
100 const std::string& name); | 101 const std::string& name); |
101 | 102 |
102 SetPrefResult SetCrosSettingsPref(const std::string& name, | 103 SetPrefResult SetCrosSettingsPref(const std::string& name, |
103 const base::Value* value); | 104 const base::Value* value); |
104 | 105 |
| 106 private: |
| 107 const Extension* GetExtensionControllingPref( |
| 108 const api::settings_private::PrefObject& pref_object); |
| 109 |
105 Profile* profile_; // weak | 110 Profile* profile_; // weak |
106 }; | 111 }; |
107 | 112 |
108 } // namespace extensions | 113 } // namespace extensions |
109 | 114 |
110 #endif // CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_PREFS_UTIL_H_ | 115 #endif // CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_PREFS_UTIL_H_ |
OLD | NEW |