Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 | 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_SCRIPTING_PERMISSIONS_MODIFIER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_SCRIPTING_PERMISSIONS_MODIFIER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_SCRIPTING_PERMISSIONS_MODIFIER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_SCRIPTING_PERMISSIONS_MODIFIER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 81 // permissions that can be granted, and |withheld_permissions_out| with the | 81 // permissions that can be granted, and |withheld_permissions_out| with the |
| 82 // set of all withheld permissions. | 82 // set of all withheld permissions. |
| 83 // If |use_initial_state| is true, this will treat the extension as though it | 83 // If |use_initial_state| is true, this will treat the extension as though it |
| 84 // was just installed, not taking into account extra granted preferences. | 84 // was just installed, not taking into account extra granted preferences. |
| 85 void WithholdPermissions( | 85 void WithholdPermissions( |
| 86 const PermissionSet& permissions, | 86 const PermissionSet& permissions, |
| 87 std::unique_ptr<const PermissionSet>* granted_permissions_out, | 87 std::unique_ptr<const PermissionSet>* granted_permissions_out, |
| 88 std::unique_ptr<const PermissionSet>* withheld_permissions_out, | 88 std::unique_ptr<const PermissionSet>* withheld_permissions_out, |
| 89 bool use_initial_state); | 89 bool use_initial_state); |
| 90 | 90 |
| 91 #if defined(OS_CHROMEOS) | |
| 92 // Revokes kClipboardRead permission (used in Public Sessions to secure | |
| 93 // clipboard read functionality). | |
| 94 void WithholdClipboardRead(); | |
|
Devlin
2017/04/03 20:39:20
This isn't a script permission, so doesn't really
| |
| 95 #endif | |
| 96 | |
| 91 private: | 97 private: |
| 92 // Grants any withheld all-hosts (or all-hosts-like) permissions. | 98 // Grants any withheld all-hosts (or all-hosts-like) permissions. |
| 93 void GrantWithheldImpliedAllHosts(); | 99 void GrantWithheldImpliedAllHosts(); |
| 94 | 100 |
| 95 // Revokes any granted all-hosts (or all-hosts-like) permissions. | 101 // Revokes any granted all-hosts (or all-hosts-like) permissions. |
| 96 void WithholdImpliedAllHosts(); | 102 void WithholdImpliedAllHosts(); |
| 97 | 103 |
| 98 // Updates extension prefs in the case of improper values being found for | 104 // Updates extension prefs in the case of improper values being found for |
| 99 // an extension. | 105 // an extension. |
| 100 void CleanUpPrefsIfNecessary(); | 106 void CleanUpPrefsIfNecessary(); |
| 101 | 107 |
| 102 content::BrowserContext* browser_context_; | 108 content::BrowserContext* browser_context_; |
| 103 | 109 |
| 104 scoped_refptr<const Extension> extension_; | 110 scoped_refptr<const Extension> extension_; |
| 105 | 111 |
| 106 ExtensionPrefs* extension_prefs_; | 112 ExtensionPrefs* extension_prefs_; |
| 107 | 113 |
| 108 DISALLOW_COPY_AND_ASSIGN(ScriptingPermissionsModifier); | 114 DISALLOW_COPY_AND_ASSIGN(ScriptingPermissionsModifier); |
| 109 }; | 115 }; |
| 110 | 116 |
| 111 } // namespace extensions | 117 } // namespace extensions |
| 112 | 118 |
| 113 #endif // CHROME_BROWSER_EXTENSIONS_SCRIPTING_PERMISSIONS_MODIFIER_H_ | 119 #endif // CHROME_BROWSER_EXTENSIONS_SCRIPTING_PERMISSIONS_MODIFIER_H_ |
| OLD | NEW |