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

Unified Diff: chrome/common/extensions/api/extension_api.cc

Issue 11316164: Implement ComplexFeature to support permission features with multiple rules. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 8 years 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/common/extensions/api/extension_api.cc
diff --git a/chrome/common/extensions/api/extension_api.cc b/chrome/common/extensions/api/extension_api.cc
index 0a9766348df2958092fca441eb8149fbd18457ce..089f6f9d0327b9fb674c806bcd35e4d3e4904254 100644
--- a/chrome/common/extensions/api/extension_api.cc
+++ b/chrome/common/extensions/api/extension_api.cc
@@ -18,6 +18,7 @@
#include "base/values.h"
#include "chrome/common/extensions/api/generated_schemas.h"
#include "chrome/common/extensions/extension.h"
+#include "chrome/common/extensions/features/simple_feature.h"
#include "chrome/common/extensions/features/simple_feature_provider.h"
#include "chrome/common/extensions/permissions/permission_set.h"
#include "googleurl/src/gurl.h"
@@ -286,7 +287,7 @@ void ExtensionAPI::LoadSchema(const std::string& name,
if (!uses_feature_system)
continue;
- Feature* feature = new Feature();
+ SimpleFeature* feature = new SimpleFeature();
feature->set_name(schema_namespace);
feature->Parse(schema);
@@ -307,7 +308,7 @@ void ExtensionAPI::LoadSchema(const std::string& name,
DictionaryValue* child = NULL;
CHECK(child_list->GetDictionary(j, &child));
- scoped_ptr<Feature> child_feature(new Feature(*feature));
+ scoped_ptr<SimpleFeature> child_feature(new SimpleFeature(*feature));
child_feature->Parse(child);
if (child_feature->Equals(*feature))
continue; // no need to store no-op features
@@ -525,8 +526,8 @@ bool ExtensionAPI::IsPrivileged(const std::string& full_name) {
iter != resolved_dependencies.end(); ++iter) {
Feature* dependency = GetFeatureDependency(*iter);
for (std::set<Feature::Context>::iterator context =
- dependency->contexts()->begin();
- context != dependency->contexts()->end(); ++context) {
+ dependency->GetContexts()->begin();
+ context != dependency->GetContexts()->end(); ++context) {
if (*context != Feature::BLESSED_EXTENSION_CONTEXT)
return false;
}
@@ -714,7 +715,7 @@ Feature* ExtensionAPI::GetFeature(const std::string& full_name) {
result = parent_feature->second.get();
}
- if (result->contexts()->empty()) {
+ if (result->GetContexts()->empty()) {
LOG(ERROR) << "API feature '" << full_name
<< "' must specify at least one context.";
return NULL;

Powered by Google App Engine
This is Rietveld 408576698