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

Side by Side Diff: chrome/browser/extensions/extension_preference_helpers.h

Issue 10952021: Moving preference API into api/preferences (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 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_EXTENSION_PREFERENCE_HELPERS_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFERENCE_HELPERS_H_
7
8 #include <string>
9
10 #include "chrome/common/extensions/permissions/permission_set.h"
11 #include "chrome/browser/extensions/extension_prefs_scope.h"
12
13 class Profile;
14
15 namespace base {
16 class ListValue;
17 };
18
19 namespace extension_preference_helpers {
20
21 bool StringToScope(const std::string& s,
22 extensions::ExtensionPrefsScope* scope);
23
24 // Returns a string constant (defined in the API) indicating the level of
25 // control this extension has over the specified preference.
26 const char* GetLevelOfControl(
27 Profile* profile,
28 const std::string& extension_id,
29 const std::string& browser_pref,
30 bool incognito);
31
32 // Dispatches |event_name| to extensions listening to the event and holding
33 // |permission|. |args| is passed as arguments to the event listener. A
34 // key-value for the level of control the extension has over |browser_pref| is
35 // injected into the first item of |args|, which must be of type
36 // DictionaryValue.
37 void DispatchEventToExtensions(
38 Profile* profile,
39 const std::string& event_name,
40 base::ListValue* args,
41 extensions::APIPermission::ID permission,
42 bool incognito,
43 const std::string& browser_pref);
44
45 } // namespace extension_preference_helpers
46
47 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFERENCE_HELPERS_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_preference_apitest.cc ('k') | chrome/browser/extensions/extension_preference_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698