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

Side by Side Diff: chrome/browser/extensions/permissions_based_management_policy_provider.cc

Issue 1349613003: [Extensions] Un-refcount PermissionSet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 3 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
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 4
5 #include "chrome/browser/extensions/permissions_based_management_policy_provider .h" 5 #include "chrome/browser/extensions/permissions_based_management_policy_provider .h"
6 6
7 #include "base/strings/string16.h" 7 #include "base/strings/string16.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/extensions/extension_management.h" 9 #include "chrome/browser/extensions/extension_management.h"
10 #include "extensions/common/extension.h" 10 #include "extensions/common/extension.h"
(...skipping 23 matching lines...) Expand all
34 #endif 34 #endif
35 } 35 }
36 36
37 bool PermissionsBasedManagementPolicyProvider::UserMayLoad( 37 bool PermissionsBasedManagementPolicyProvider::UserMayLoad(
38 const Extension* extension, 38 const Extension* extension,
39 base::string16* error) const { 39 base::string16* error) const {
40 // Component extensions are always allowed. 40 // Component extensions are always allowed.
41 if (Manifest::IsComponentLocation(extension->location())) 41 if (Manifest::IsComponentLocation(extension->location()))
42 return true; 42 return true;
43 43
44 scoped_refptr<const PermissionSet> required_permissions = 44 const PermissionSet* required_permissions =
45 PermissionsParser::GetRequiredPermissions(extension); 45 PermissionsParser::GetRequiredPermissions(extension);
46 46
47 if (!settings_->IsPermissionSetAllowed(extension, required_permissions)) { 47 if (!settings_->IsPermissionSetAllowed(extension, *required_permissions)) {
48 if (error) { 48 if (error) {
49 *error = 49 *error =
50 l10n_util::GetStringFUTF16(IDS_EXTENSION_CANT_INSTALL_POLICY_BLOCKED, 50 l10n_util::GetStringFUTF16(IDS_EXTENSION_CANT_INSTALL_POLICY_BLOCKED,
51 base::UTF8ToUTF16(extension->name()), 51 base::UTF8ToUTF16(extension->name()),
52 base::UTF8ToUTF16(extension->id())); 52 base::UTF8ToUTF16(extension->id()));
53 } 53 }
54 return false; 54 return false;
55 } 55 }
56 56
57 return true; 57 return true;
58 } 58 }
59 59
60 } // namespace extensions 60 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/permission_messages_unittest.cc ('k') | chrome/browser/extensions/permissions_updater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698