Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1298)

Side by Side Diff: chrome/browser/extensions/api/settings_private/prefs_util.h

Issue 1061613002: chrome.settingsPrivate: Implement onPrefsChanged event handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a direct memory leak Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/settings_private/prefs_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_PREFS_UTIL_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_PREFS_UTIL_H_
7
8 #include <map>
9 #include <string>
10
11 #include "base/macros.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "chrome/common/extensions/api/settings_private.h"
14
15 class PrefService;
16 class Profile;
17
18 namespace extensions {
19
20 namespace prefs_util {
21
22 using TypedPrefMap = std::map<std::string, api::settings_private::PrefType>;
23
24 // Gets the list of whitelisted pref keys -- that is, those which correspond to
25 // prefs that clients of the settingsPrivate API may retrieve and manipulate.
26 const TypedPrefMap& GetWhitelistedKeys();
27
28 // Gets the value of the pref with the given |name|. Returns a pointer to an
29 // empty PrefObject if no pref is found for |name|.
30 scoped_ptr<api::settings_private::PrefObject> GetPref(Profile* profile,
31 const std::string& name);
32
33 // Returns whether |pref_name| corresponds to a pref whose type is URL.
34 bool IsPrefTypeURL(const std::string& pref_name);
35
36 // Returns whether |pref_name| corresponds to a pref that is user modifiable
37 // (i.e., not made restricted by a user or device policy).
38 bool IsPrefUserModifiable(Profile* profile, const std::string& pref_name);
39
40 // Returns a pointer to the appropriate PrefService instance for the given
41 // |pref_name|.
42 PrefService* FindServiceForPref(Profile* profile, const std::string& pref_name);
43
44 } // namespace prefs_util
45
46 } // namespace extensions
47
48 #endif // CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_PREFS_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/settings_private/prefs_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698