Add ENABLE_MEDIA_ROUTER define to builds other than Android and iOS.
[chromium-blink-merge.git] / chrome / browser / extensions / api / preference / preference_helpers.h
blobba227af44a617d8f2c91a669ca97369148ae31bb
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.
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_PREFERENCE_PREFERENCE_HELPERS_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_PREFERENCE_PREFERENCE_HELPERS_H_
8 #include <string>
10 #include "extensions/browser/extension_prefs_scope.h"
11 #include "extensions/common/permissions/permission_set.h"
13 class Profile;
15 namespace base {
16 class ListValue;
19 namespace extensions {
20 namespace preference_helpers {
22 bool StringToScope(const std::string& s,
23 extensions::ExtensionPrefsScope* scope);
25 // Returns a string constant (defined in the API) indicating the level of
26 // control this extension has over the specified preference.
27 const char* GetLevelOfControl(
28 Profile* profile,
29 const std::string& extension_id,
30 const std::string& browser_pref,
31 bool incognito);
33 // Dispatches |event_name| to extensions listening to the event and holding
34 // |permission|. |args| is passed as arguments to the event listener. A
35 // key-value for the level of control the extension has over |browser_pref| is
36 // injected into the first item of |args|, which must be of type
37 // DictionaryValue.
38 void DispatchEventToExtensions(
39 Profile* profile,
40 const std::string& event_name,
41 base::ListValue* args,
42 extensions::APIPermission::ID permission,
43 bool incognito,
44 const std::string& browser_pref);
46 } // namespace preference_helpers
47 } // namespace extensions
49 #endif // CHROME_BROWSER_EXTENSIONS_API_PREFERENCE_PREFERENCE_HELPERS_H_