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 grant permissions |
| 62 // to extensions automatically. Instead, these settings will provide a list of |
| 63 // blocked permissions for each extension. That is, if an extension requires a |
| 64 // permission which has been blacklisted, this extension will not be allowed |
| 65 // to load. And if it contains a blocked permission as optional requirement, |
| 66 // it will be allowed to load (of course, with permission granted from user if |
| 67 // necessary), but conflicting permissions will be dropped. These settings |
| 68 // will merge from the default settings, and unspecified settings will take |
| 69 // value from default settings. |
| 70 APIPermissionSet blocked_permissions; |
| 71 |
58 private: | 72 private: |
59 DISALLOW_ASSIGN(IndividualSettings); | 73 DISALLOW_ASSIGN(IndividualSettings); |
60 }; | 74 }; |
61 | 75 |
62 // Global extension management settings, applicable to all extensions. | 76 // Global extension management settings, applicable to all extensions. |
63 struct GlobalSettings { | 77 struct GlobalSettings { |
64 GlobalSettings(); | 78 GlobalSettings(); |
65 ~GlobalSettings(); | 79 ~GlobalSettings(); |
66 | 80 |
67 void Reset(); | 81 void Reset(); |
(...skipping 10 matching lines...) Expand all Loading... |
78 | 92 |
79 private: | 93 private: |
80 DISALLOW_COPY_AND_ASSIGN(GlobalSettings); | 94 DISALLOW_COPY_AND_ASSIGN(GlobalSettings); |
81 }; | 95 }; |
82 | 96 |
83 } // namespace internal | 97 } // namespace internal |
84 | 98 |
85 } // namespace extensions | 99 } // namespace extensions |
86 | 100 |
87 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_INTERNAL_H_ | 101 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_INTERNAL_H_ |
OLD | NEW |