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

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

Issue 595363002: Add policy controlled permission block list for extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ext-fix
Patch Set: add extension api test Created 6 years, 1 month 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
OLDNEW
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
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
Finnur 2014/10/30 14:16:59 nit: s/give granted/grant/ ?
binjin 2014/10/30 16:41:11 Done.
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,
Finnur 2014/10/30 14:16:59 s/is on the blocklist for it/has been blacklisted/
binjin 2014/10/30 16:41:11 Done.
65 // this extension will not be allowed to be loaded. And if it contains a
Finnur 2014/10/30 14:16:59 s/be loaded/load/
binjin 2014/10/30 16:41:11 Done.
66 // blocked permission as optional requirement, it will be allowed to
67 // be loaded (of course, with permission granted from other part of
Finnur 2014/10/30 14:16:59 s/be loaded/load/ "with permission granted from o
binjin 2014/10/30 16:41:11 Done. I mean "granted by user if necessary", updat
68 // extension system), but conflicting permissions will not be usable.
Finnur 2014/10/30 14:16:59 nit: s/not be usable/be dropped/ ?
binjin 2014/10/30 16:41:11 Done.
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698