Index: chrome/common/extensions/manifest_feature.cc |
diff --git a/chrome/common/extensions/manifest_feature.cc b/chrome/common/extensions/manifest_feature.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c9a62da2c03a63e0e7cc4b14593dcad29821ea03 |
--- /dev/null |
+++ b/chrome/common/extensions/manifest_feature.cc |
@@ -0,0 +1,35 @@ |
+// Copyright (c) 2012 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 "chrome/common/extensions/manifest_feature.h" |
+ |
+#include "chrome/common/extensions/manifest.h" |
+ |
+namespace extensions { |
+ |
+ManifestFeature::ManifestFeature() { |
+} |
+ |
+ManifestFeature::~ManifestFeature() { |
+} |
+ |
+Feature::Availability ManifestFeature::IsAvailableToContext( |
+ const Extension* extension, |
+ Feature::Context context, |
+ Feature::Platform platform) const { |
+ Availability availability = Feature::IsAvailableToContext(extension, |
+ context, |
+ platform); |
+ if (availability != IS_AVAILABLE) |
+ return availability; |
+ |
+ // We know we can skip manifest()->GetKey() here because we just did the same |
+ // validation it would do above. |
+ if (!extension->manifest()->value()->HasKey(name())) |
+ return NOT_PRESENT; |
+ |
+ return IS_AVAILABLE; |
+} |
+ |
+} // namespace |