OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_INTERNAL_H_ | 4 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_INTERNAL_H_ |
5 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_INTERNAL_H_ | 5 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_INTERNAL_H_ |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "chrome/browser/extensions/extension_management.h" | 11 #include "chrome/browser/extensions/extension_management.h" |
12 #include "extensions/common/manifest.h" | 12 #include "extensions/common/manifest.h" |
| 13 #include "extensions/common/permissions/api_permission_set.h" |
13 | 14 |
14 namespace base { | 15 namespace base { |
15 class DictionaryValue; | 16 class DictionaryValue; |
16 } // namespace base | 17 } // namespace base |
17 | 18 |
18 namespace extensions { | 19 namespace extensions { |
19 | 20 |
20 class URLPatternSet; | 21 class URLPatternSet; |
21 | 22 |
22 namespace internal { | 23 namespace internal { |
(...skipping 12 matching lines...) Expand all Loading... |
35 | 36 |
36 IndividualSettings(); | 37 IndividualSettings(); |
37 ~IndividualSettings(); | 38 ~IndividualSettings(); |
38 | 39 |
39 void Reset(); | 40 void Reset(); |
40 | 41 |
41 // Parses the individual settings. |dict| is the a sub-dictionary in extension | 42 // Parses the individual settings. |dict| is the a sub-dictionary in extension |
42 // management preference and |scope| represents the applicable range of the | 43 // management preference and |scope| represents the applicable range of the |
43 // settings, a single extension, a group of extensions or default settings. | 44 // settings, a single extension, a group of extensions or default settings. |
44 // Note that in case of parsing errors, |this| will NOT be left untouched. | 45 // Note that in case of parsing errors, |this| will NOT be left untouched. |
| 46 // This method is required to be called in order of ParsingScope, i.e. first |
| 47 // SCOPE_DEFAULT, then SCOPE_INDIVIDUAL. |
45 bool Parse(const base::DictionaryValue* dict, ParsingScope scope); | 48 bool Parse(const base::DictionaryValue* dict, ParsingScope scope); |
46 | 49 |
47 // Extension installation mode. Setting this to INSTALLATION_FORCED or | 50 // Extension installation mode. Setting this to INSTALLATION_FORCED or |
48 // INSTALLATION_RECOMMENDED will enable extension auto-loading (only | 51 // INSTALLATION_RECOMMENDED will enable extension auto-loading (only |
49 // applicable to single extension), and in this case the |update_url| must | 52 // applicable to single extension), and in this case the |update_url| must |
50 // be specified, containing the update URL for this extension. | 53 // be specified, containing the update URL for this extension. |
51 // Note that |update_url| will be ignored for INSTALLATION_ALLOWED and | 54 // Note that |update_url| will be ignored for INSTALLATION_ALLOWED and |
52 // INSTALLATION_BLOCKED installation mode. | 55 // INSTALLATION_BLOCKED installation mode. |
53 // These settings will override the default settings, and unspecified | 56 // These settings will override the default settings, and unspecified |
54 // settings will take value from default settings. | 57 // settings will take value from default settings. |
55 ExtensionManagement::InstallationMode installation_mode; | 58 ExtensionManagement::InstallationMode installation_mode; |
56 std::string update_url; | 59 std::string update_url; |
57 | 60 |
| 61 // Permissions settings for extensions. These settings won't give granted |
| 62 // permissions to extensions automatically. Instead, these settings will |
| 63 // provide a list of blocked permissions for each extension. That is, if |
| 64 // an extension requires a permission which is on the blocklist for it, |
| 65 // this extension will not be allowed to be loaded. And if it contains a |
| 66 // blocked permission as optional requirement, it will be allowed to |
| 67 // be loaded (of course, with permission granted from other part of |
| 68 // extension system), but conflicting permissions will not be usable. |
| 69 // These settings will merge from the default settings, and unspecified |
| 70 // settings will take value from default settings. |
| 71 APIPermissionSet blocked_permissions; |
| 72 |
58 private: | 73 private: |
59 DISALLOW_ASSIGN(IndividualSettings); | 74 DISALLOW_ASSIGN(IndividualSettings); |
60 }; | 75 }; |
61 | 76 |
62 // Global extension management settings, applicable to all extensions. | 77 // Global extension management settings, applicable to all extensions. |
63 struct GlobalSettings { | 78 struct GlobalSettings { |
64 GlobalSettings(); | 79 GlobalSettings(); |
65 ~GlobalSettings(); | 80 ~GlobalSettings(); |
66 | 81 |
67 void Reset(); | 82 void Reset(); |
(...skipping 10 matching lines...) Expand all Loading... |
78 | 93 |
79 private: | 94 private: |
80 DISALLOW_COPY_AND_ASSIGN(GlobalSettings); | 95 DISALLOW_COPY_AND_ASSIGN(GlobalSettings); |
81 }; | 96 }; |
82 | 97 |
83 } // namespace internal | 98 } // namespace internal |
84 | 99 |
85 } // namespace extensions | 100 } // namespace extensions |
86 | 101 |
87 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_INTERNAL_H_ | 102 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_INTERNAL_H_ |
OLD | NEW |