| 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 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 explicit PrefsUtil(Profile* profile); | 25 explicit PrefsUtil(Profile* profile); |
| 26 virtual ~PrefsUtil(); | 26 virtual ~PrefsUtil(); |
| 27 | 27 |
| 28 // Gets the list of whitelisted pref keys -- that is, those which correspond | 28 // Gets the list of whitelisted pref keys -- that is, those which correspond |
| 29 // to prefs that clients of the settingsPrivate API may retrieve and | 29 // to prefs that clients of the settingsPrivate API may retrieve and |
| 30 // manipulate. | 30 // manipulate. |
| 31 const TypedPrefMap& GetWhitelistedKeys(); | 31 const TypedPrefMap& GetWhitelistedKeys(); |
| 32 | 32 |
| 33 // Gets the value of the pref with the given |name|. Returns a pointer to an | 33 // Gets the value of the pref with the given |name|. Returns a pointer to an |
| 34 // empty PrefObject if no pref is found for |name|. | 34 // empty PrefData if no pref is found for |name|. |
| 35 virtual scoped_ptr<api::settings_private::PrefObject> GetPref( | 35 virtual scoped_ptr<api::settings_private::PrefData> GetPref( |
| 36 const std::string& name); | 36 const std::string& name); |
| 37 | 37 |
| 38 // Sets the pref with the given name and value in the proper PrefService. | 38 // Sets the pref with the given name and value in the proper PrefService. |
| 39 virtual bool SetPref(const std::string& name, const base::Value* value); | 39 virtual bool SetPref(const std::string& name, const base::Value* value); |
| 40 | 40 |
| 41 // Appends the given |value| to the list setting specified by the path in | 41 // Appends the given |value| to the list setting specified by the path in |
| 42 // |pref_name|. | 42 // |pref_name|. |
| 43 virtual bool AppendToListCrosSetting(const std::string& pref_name, | 43 virtual bool AppendToListCrosSetting(const std::string& pref_name, |
| 44 const base::Value& value); | 44 const base::Value& value); |
| 45 | 45 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 59 // Returns whether |pref_name| corresponds to a pref whose type is URL. | 59 // Returns whether |pref_name| corresponds to a pref whose type is URL. |
| 60 bool IsPrefTypeURL(const std::string& pref_name); | 60 bool IsPrefTypeURL(const std::string& pref_name); |
| 61 | 61 |
| 62 // Returns whether |pref_name| corresponds to a pref that is user modifiable | 62 // Returns whether |pref_name| corresponds to a pref that is user modifiable |
| 63 // (i.e., not made restricted by a user or device policy). | 63 // (i.e., not made restricted by a user or device policy). |
| 64 bool IsPrefUserModifiable(const std::string& pref_name); | 64 bool IsPrefUserModifiable(const std::string& pref_name); |
| 65 | 65 |
| 66 api::settings_private::PrefType GetType(const std::string& name, | 66 api::settings_private::PrefType GetType(const std::string& name, |
| 67 base::Value::Type type); | 67 base::Value::Type type); |
| 68 | 68 |
| 69 scoped_ptr<api::settings_private::PrefObject> GetCrosSettingsPref( | 69 scoped_ptr<api::settings_private::PrefData> GetCrosSettingsPref( |
| 70 const std::string& name); | 70 const std::string& name); |
| 71 | 71 |
| 72 bool SetCrosSettingsPref(const std::string& name, const base::Value* value); | 72 bool SetCrosSettingsPref(const std::string& name, const base::Value* value); |
| 73 | 73 |
| 74 Profile* profile_; // weak | 74 Profile* profile_; // weak |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 } // namespace extensions | 77 } // namespace extensions |
| 78 | 78 |
| 79 #endif // CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_PREFS_UTIL_H_ | 79 #endif // CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_PREFS_UTIL_H_ |
| OLD | NEW |