OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 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 #include "chrome/browser/chromeos/extensions/permissions_updater_delegate_chrome os.h" | 5 #include "chrome/browser/chromeos/extensions/permissions_updater_delegate_chrome os.h" |
6 | 6 |
7 #include "chrome/browser/chromeos/extensions/device_local_account_management_pol icy_provider.h" | 7 #include "chrome/browser/chromeos/extensions/device_local_account_management_pol icy_provider.h" |
8 #include "chrome/browser/profiles/profiles_state.h" | 8 #include "chrome/browser/profiles/profiles_state.h" |
9 #include "extensions/common/permissions/api_permission.h" | 9 #include "extensions/common/permissions/api_permission.h" |
10 #include "extensions/common/permissions/api_permission_set.h" | 10 #include "extensions/common/permissions/api_permission_set.h" |
(...skipping 16 matching lines...) Expand all Loading... | |
27 !(*granted_permissions) | 27 !(*granted_permissions) |
28 ->HasAPIPermission(APIPermission::kClipboardRead)) { | 28 ->HasAPIPermission(APIPermission::kClipboardRead)) { |
29 return; | 29 return; |
30 } | 30 } |
31 // Revoke kClipboardRead permission (used in Public Sessions to secure | 31 // Revoke kClipboardRead permission (used in Public Sessions to secure |
32 // clipboard read functionality). This forceful removal of permission is safe | 32 // clipboard read functionality). This forceful removal of permission is safe |
33 // since the clipboard pasting code checks for this permission before doing | 33 // since the clipboard pasting code checks for this permission before doing |
34 // the paste (the end result is just an empty paste). | 34 // the paste (the end result is just an empty paste). |
35 APIPermissionSet api_permission_set((*granted_permissions)->apis()); | 35 APIPermissionSet api_permission_set((*granted_permissions)->apis()); |
36 api_permission_set.erase(APIPermission::kClipboardRead); | 36 api_permission_set.erase(APIPermission::kClipboardRead); |
37 granted_permissions->reset( | 37 granted_permissions->reset(new PermissionSet( |
38 new PermissionSet(api_permission_set, ManifestPermissionSet(), | 38 api_permission_set, (*granted_permissions)->manifest_permissions(), |
Ivan Šandrk
2017/04/25 18:51:59
Should I maybe have a temporary helper variable to
Devlin
2017/04/25 18:57:48
I'd say it's probably not worth it, since this is
Ivan Šandrk
2017/04/25 19:42:11
I guess it's not worth the bother.
| |
39 URLPatternSet(), URLPatternSet())); | 39 (*granted_permissions)->explicit_hosts(), |
40 (*granted_permissions)->scriptable_hosts())); | |
40 } | 41 } |
41 | 42 |
42 } // namespace extensions | 43 } // namespace extensions |
OLD | NEW |