Index: extensions/common/api/declarative/declarative_manifest_handler.cc |
diff --git a/extensions/common/api/declarative/declarative_manifest_handler.cc b/extensions/common/api/declarative/declarative_manifest_handler.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b96ddf68ad60358aa932f0046477a37d2010955b |
--- /dev/null |
+++ b/extensions/common/api/declarative/declarative_manifest_handler.cc |
@@ -0,0 +1,36 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "extensions/common/api/declarative/declarative_manifest_handler.h" |
+ |
+#include "extensions/common/api/declarative/declarative_manifest_data.h" |
+#include "extensions/common/extension.h" |
+#include "extensions/common/manifest_constants.h" |
+ |
+namespace extensions { |
+ |
+DeclarativeManifestHandler::DeclarativeManifestHandler() { |
+} |
+ |
+DeclarativeManifestHandler::~DeclarativeManifestHandler() { |
+} |
+ |
+bool DeclarativeManifestHandler::Parse(Extension* extension, |
+ base::string16* error) { |
+ const base::Value* event_rules = NULL; |
+ CHECK(extension->manifest()->Get(manifest_keys::kEventRules, &event_rules)); |
+ scoped_ptr<DeclarativeManifestData> data = |
+ DeclarativeManifestData::FromValue(*event_rules, error); |
+ if (!data) |
+ return false; |
+ |
+ extension->SetManifestData(manifest_keys::kEventRules, data.release()); |
+ return true; |
+} |
+ |
+const std::vector<std::string> DeclarativeManifestHandler::Keys() const { |
+ return SingleKey(manifest_keys::kEventRules); |
+} |
+ |
+} // namespace extensions |