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

Unified Diff: chrome/browser/extensions/extension_service.cc

Issue 10675007: Move each permission classes to its own files in extensions/permissions (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase again Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 4a3a83afe9eaa054277e6ef8ba91db0831e51185..05adaae163c984a5a5a7d9b0b16ecf6cab876315 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -134,6 +134,9 @@ using extensions::Extension;
using extensions::ExtensionIdSet;
using extensions::ExtensionInfo;
using extensions::UnloadedExtensionInfo;
+using extensions::PermissionMessage;
+using extensions::PermissionMessages;
+using extensions::PermissionSet;
namespace errors = extension_manifest_errors;
@@ -903,15 +906,15 @@ void ExtensionService::RecordPermissionMessagesHistogram(
base::Histogram* counter = base::LinearHistogram::FactoryGet(
histogram,
1,
- ExtensionPermissionMessage::kEnumBoundary,
- ExtensionPermissionMessage::kEnumBoundary + 1,
+ PermissionMessage::kEnumBoundary,
+ PermissionMessage::kEnumBoundary + 1,
base::Histogram::kUmaTargetedHistogramFlag);
- ExtensionPermissionMessages permissions = e->GetPermissionMessages();
+ PermissionMessages permissions = e->GetPermissionMessages();
if (permissions.empty()) {
- counter->Add(ExtensionPermissionMessage::kNone);
+ counter->Add(PermissionMessage::kNone);
} else {
- for (ExtensionPermissionMessages::iterator it = permissions.begin();
+ for (PermissionMessages::iterator it = permissions.begin();
it != permissions.end(); ++it)
counter->Add(it->id());
}
@@ -1956,7 +1959,7 @@ void ExtensionService::InitializePermissions(const Extension* extension) {
// If the extension has used the optional permissions API, it will have a
// custom set of active permissions defined in the extension prefs. Here,
// we update the extension's active permissions based on the prefs.
- scoped_refptr<ExtensionPermissionSet> active_permissions =
+ scoped_refptr<PermissionSet> active_permissions =
extension_prefs()->GetActivePermissions(extension->id());
if (active_permissions.get()) {
@@ -1964,18 +1967,18 @@ void ExtensionService::InitializePermissions(const Extension* extension) {
// extension's manifest.
// a) active permissions must be a subset of optional + default permissions
// b) active permissions must contains all default permissions
- scoped_refptr<ExtensionPermissionSet> total_permissions =
- ExtensionPermissionSet::CreateUnion(
+ scoped_refptr<PermissionSet> total_permissions =
+ PermissionSet::CreateUnion(
extension->required_permission_set(),
extension->optional_permission_set());
// Make sure the active permissions contain no more than optional + default.
- scoped_refptr<ExtensionPermissionSet> adjusted_active =
- ExtensionPermissionSet::CreateIntersection(
+ scoped_refptr<PermissionSet> adjusted_active =
+ PermissionSet::CreateIntersection(
total_permissions.get(), active_permissions.get());
// Make sure the active permissions contain the default permissions.
- adjusted_active = ExtensionPermissionSet::CreateUnion(
+ adjusted_active = PermissionSet::CreateUnion(
extension->required_permission_set(), adjusted_active.get());
extensions::PermissionsUpdater perms_updater(profile());
@@ -2016,7 +2019,7 @@ void ExtensionService::InitializePermissions(const Extension* extension) {
if (!extension->CanSilentlyIncreasePermissions()) {
// Add all the recognized permissions if the granted permissions list
// hasn't been initialized yet.
- scoped_refptr<ExtensionPermissionSet> granted_permissions =
+ scoped_refptr<PermissionSet> granted_permissions =
extension_prefs_->GetGrantedPermissions(extension->id());
CHECK(granted_permissions.get());
« no previous file with comments | « chrome/browser/extensions/extension_prefs_unittest.cc ('k') | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698