Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 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. | |
| 4 | |
| 5 #include "chrome/browser/extensions/permissions_updater_delegate_chromeos.h" | |
| 6 | |
| 7 #include "chrome/browser/chromeos/extensions/device_local_account_management_pol icy_provider.h" | |
| 8 #include "chrome/browser/profiles/profiles_state.h" | |
| 9 #include "extensions/common/permissions/api_permission.h" | |
| 10 #include "extensions/common/permissions/api_permission_set.h" | |
| 11 #include "extensions/common/permissions/manifest_permission_set.h" | |
| 12 #include "extensions/common/permissions/permission_set.h" | |
| 13 #include "extensions/common/url_pattern_set.h" | |
| 14 | |
| 15 namespace extensions { | |
| 16 | |
| 17 PermissionsUpdaterDelegateChromeOS::PermissionsUpdaterDelegateChromeOS() {} | |
| 18 | |
| 19 PermissionsUpdaterDelegateChromeOS::~PermissionsUpdaterDelegateChromeOS() {} | |
| 20 | |
| 21 void PermissionsUpdaterDelegateChromeOS::InitializePermissions( | |
| 22 PermissionsUpdater* permissions_updater, | |
| 23 const Extension* extension) { | |
| 24 if (!profiles::IsPublicSession() || | |
| 25 chromeos::DeviceLocalAccountManagementPolicyProvider::IsWhitelisted( | |
| 26 extension)) { | |
| 27 return; | |
| 28 } | |
| 29 | |
| 30 // Revoke kClipboardRead permission (used in Public Sessions to secure | |
| 31 // clipboard read functionality). | |
| 32 APIPermissionSet api_permission_set; | |
| 33 api_permission_set.insert(APIPermission::kClipboardRead); | |
| 34 PermissionSet permissions(api_permission_set, ManifestPermissionSet(), | |
| 35 URLPatternSet(), URLPatternSet()); | |
| 36 permissions_updater->RemovePermissionsUnsafe(extension, permissions); | |
|
Devlin
2017/04/05 14:35:20
this does a lot of extra work (e.g. notifying subs
Ivan Šandrk
2017/04/07 14:39:40
Thanks for the explanation, done.
| |
| 37 } | |
| 38 | |
| 39 } // namespace extensions | |
| OLD | NEW |