Index: chrome/browser/extensions/api/settings_private/prefs_util.h |
diff --git a/chrome/browser/extensions/api/settings_private/prefs_util.h b/chrome/browser/extensions/api/settings_private/prefs_util.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8b0fbbf684ed5ef95c18ab27c250dea74f84949d |
--- /dev/null |
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.h |
@@ -0,0 +1,40 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_PREFS_UTIL_H_ |
+#define CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_PREFS_UTIL_H_ |
+ |
+#include <map> |
+#include <string> |
+ |
+#include "base/macros.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "chrome/common/extensions/api/settings_private.h" |
+ |
+class PrefService; |
+class Profile; |
+ |
+namespace extensions { |
+ |
+namespace prefs_util { |
+ |
+using TypedPrefMap = std::map<std::string, api::settings_private::PrefType>; |
+ |
+const TypedPrefMap& GetWhitelistedKeys(); |
stevenjb
2015/04/06 22:40:59
All of these functions should have comments.
Oren Blasberg
2015/04/06 23:27:06
Done.
|
+ |
+// Gets the value of the pref with the given |name|. |
stevenjb
2015/04/06 22:40:59
Describe behavior if |name| is not found. (i.e. Re
Oren Blasberg
2015/04/06 23:27:06
Done.
|
+scoped_ptr<api::settings_private::PrefObject> GetPref(Profile* profile, |
+ const std::string& name); |
+ |
+bool IsPrefTypeURL(const std::string& pref_name); |
+ |
+bool IsPrefUserModifiable(Profile* profile, const std::string& pref_name); |
+ |
+PrefService* FindServiceForPref(Profile* profile, const std::string& pref_name); |
+ |
+} // namespace prefs_util |
+ |
+} // namespace extensions |
+ |
+#endif // CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_PREFS_UTIL_H_ |