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

Unified Diff: chrome/browser/extensions/api/permissions/permissions_api_helpers.cc

Issue 10649003: 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 on HEAD 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/api/permissions/permissions_api_helpers.cc
diff --git a/chrome/browser/extensions/api/permissions/permissions_api_helpers.cc b/chrome/browser/extensions/api/permissions/permissions_api_helpers.cc
index e5c31f64a6eca5eb109d33f8fb6ba2ec9350fca9..a421a9d9071b615a78280a7692a1e0836f98d657 100644
--- a/chrome/browser/extensions/api/permissions/permissions_api_helpers.cc
+++ b/chrome/browser/extensions/api/permissions/permissions_api_helpers.cc
@@ -8,9 +8,14 @@
#include "chrome/common/extensions/api/permissions.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_error_utils.h"
-#include "chrome/common/extensions/extension_permission_set.h"
+#include "chrome/common/extensions/permissions/permission_set.h"
+#include "chrome/common/extensions/permissions/permissions_info.h"
#include "chrome/common/extensions/url_pattern_set.h"
+using extensions::APIPermission;
+using extensions::PermissionSet;
+using extensions::PermissionsInfo;
+
namespace extensions {
using api::permissions::Permissions;
@@ -26,12 +31,12 @@ const char kUnknownPermissionError[] =
} // namespace
-scoped_ptr<Permissions> PackPermissionSet(const ExtensionPermissionSet* set) {
+scoped_ptr<Permissions> PackPermissionSet(const PermissionSet* set) {
Permissions* permissions(new Permissions());
permissions->permissions.reset(new std::vector<std::string>());
- ExtensionPermissionsInfo* info = ExtensionPermissionsInfo::GetInstance();
- for (ExtensionAPIPermissionSet::const_iterator i = set->apis().begin();
+ PermissionsInfo* info = PermissionsInfo::GetInstance();
+ for (APIPermissionSet::const_iterator i = set->apis().begin();
i != set->apis().end(); ++i) {
permissions->permissions->push_back(info->GetByID(*i)->name());
}
@@ -44,15 +49,15 @@ scoped_ptr<Permissions> PackPermissionSet(const ExtensionPermissionSet* set) {
return scoped_ptr<Permissions>(permissions);
}
-scoped_refptr<ExtensionPermissionSet> UnpackPermissionSet(
+scoped_refptr<PermissionSet> UnpackPermissionSet(
const Permissions& permissions, std::string* error) {
- ExtensionAPIPermissionSet apis;
+ APIPermissionSet apis;
std::vector<std::string>* permissions_list = permissions.permissions.get();
if (permissions_list) {
- ExtensionPermissionsInfo* info = ExtensionPermissionsInfo::GetInstance();
+ PermissionsInfo* info = PermissionsInfo::GetInstance();
for (std::vector<std::string>::iterator it = permissions_list->begin();
it != permissions_list->end(); ++it) {
- ExtensionAPIPermission* permission = info->GetByName(*it);
+ APIPermission* permission = info->GetByName(*it);
if (!permission) {
*error = ExtensionErrorUtils::FormatErrorMessage(
kUnknownPermissionError, *it);
@@ -79,8 +84,8 @@ scoped_refptr<ExtensionPermissionSet> UnpackPermissionSet(
}
}
- return scoped_refptr<ExtensionPermissionSet>(
- new ExtensionPermissionSet(apis, origins, URLPatternSet()));
+ return scoped_refptr<PermissionSet>(
+ new PermissionSet(apis, origins, URLPatternSet()));
}
} // namespace permissions_api

Powered by Google App Engine
This is Rietveld 408576698