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

Unified Diff: chrome/common/extensions/api/storage/storage_schema_manifest_handler.cc

Issue 24367003: Refactored users of PolicySchema to use the new policy::Schema class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/api/storage/storage_schema_manifest_handler.cc
diff --git a/chrome/common/extensions/api/storage/storage_schema_manifest_handler.cc b/chrome/common/extensions/api/storage/storage_schema_manifest_handler.cc
index 28c85576ad37a81963f855f8c9b4b91bb051f422..d95a967d350d17c3f0e2640c6b12cb8c3703c73f 100644
--- a/chrome/common/extensions/api/storage/storage_schema_manifest_handler.cc
+++ b/chrome/common/extensions/api/storage/storage_schema_manifest_handler.cc
@@ -15,7 +15,7 @@
#include "base/strings/utf_string_conversions.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/permissions/api_permission.h"
-#include "components/policy/core/common/policy_schema.h"
+#include "components/policy/core/common/schema.h"
#include "extensions/common/install_warning.h"
#include "extensions/common/manifest.h"
#include "extensions/common/manifest_constants.h"
@@ -29,13 +29,13 @@ StorageSchemaManifestHandler::StorageSchemaManifestHandler() {}
StorageSchemaManifestHandler::~StorageSchemaManifestHandler() {}
// static
-scoped_ptr<policy::PolicySchema> StorageSchemaManifestHandler::GetSchema(
+scoped_ptr<policy::SchemaOwner> StorageSchemaManifestHandler::GetSchema(
const Extension* extension,
std::string* error) {
if (!extension->HasAPIPermission(APIPermission::kStorage)) {
*error = base::StringPrintf("The storage permission is required to use %s",
kStorageManagedSchema);
- return scoped_ptr<policy::PolicySchema>();
+ return scoped_ptr<policy::SchemaOwner>();
}
std::string path;
extension->manifest()->GetString(kStorageManagedSchema, &path);
@@ -43,20 +43,20 @@ scoped_ptr<policy::PolicySchema> StorageSchemaManifestHandler::GetSchema(
if (file.IsAbsolute() || file.ReferencesParent()) {
*error = base::StringPrintf("%s must be a relative path without ..",
kStorageManagedSchema);
- return scoped_ptr<policy::PolicySchema>();
+ return scoped_ptr<policy::SchemaOwner>();
}
file = extension->path().AppendASCII(path);
if (!base::PathExists(file)) {
*error =
base::StringPrintf("File does not exist: %s", file.value().c_str());
- return scoped_ptr<policy::PolicySchema>();
+ return scoped_ptr<policy::SchemaOwner>();
}
std::string content;
if (!base::ReadFileToString(file, &content)) {
*error = base::StringPrintf("Can't read %s", file.value().c_str());
- return scoped_ptr<policy::PolicySchema>();
+ return scoped_ptr<policy::SchemaOwner>();
}
- return policy::PolicySchema::Parse(content, error);
+ return policy::SchemaOwner::Parse(content, error);
}
bool StorageSchemaManifestHandler::Parse(Extension* extension,
« no previous file with comments | « chrome/common/extensions/api/storage/storage_schema_manifest_handler.h ('k') | components/components_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698