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

Side by Side Diff: chrome/browser/chromeos/extensions/permissions_updater_delegate_chromeos.cc

Issue 2840043002: Fix for broken "Load unpacked extension" popup (Closed)
Patch Set: TODO, CreatePermissions with a parameter Created 3 years, 8 months 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/permissions_updater_delegate_chromeos_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 14 matching lines...) Expand all
25 chromeos::DeviceLocalAccountManagementPolicyProvider::IsWhitelisted( 25 chromeos::DeviceLocalAccountManagementPolicyProvider::IsWhitelisted(
26 extension) || 26 extension) ||
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;
36 api_permission_set.erase(APIPermission::kClipboardRead); 36 api_permission_set.insert(APIPermission::kClipboardRead);
37 granted_permissions->reset( 37 *granted_permissions = PermissionSet::CreateDifference(
38 new PermissionSet(api_permission_set, ManifestPermissionSet(), 38 **granted_permissions,
39 URLPatternSet(), URLPatternSet())); 39 PermissionSet(api_permission_set, ManifestPermissionSet(),
40 URLPatternSet(), URLPatternSet()));
40 } 41 }
41 42
42 } // namespace extensions 43 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/permissions_updater_delegate_chromeos_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698