| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/common/extensions/features/manifest_feature.h" | 5 #include "chrome/common/extensions/features/manifest_feature.h" |
| 6 | 6 |
| 7 #include "chrome/common/extensions/manifest.h" | 7 #include "chrome/common/extensions/manifest.h" |
| 8 | 8 |
| 9 namespace extensions { | 9 namespace extensions { |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 return availability; | 27 return availability; |
| 28 | 28 |
| 29 // We know we can skip manifest()->GetKey() here because we just did the same | 29 // We know we can skip manifest()->GetKey() here because we just did the same |
| 30 // validation it would do above. | 30 // validation it would do above. |
| 31 if (extension && !extension->manifest()->value()->HasKey(name())) | 31 if (extension && !extension->manifest()->value()->HasKey(name())) |
| 32 return CreateAvailability(NOT_PRESENT, extension->GetType()); | 32 return CreateAvailability(NOT_PRESENT, extension->GetType()); |
| 33 | 33 |
| 34 return CreateAvailability(IS_AVAILABLE); | 34 return CreateAvailability(IS_AVAILABLE); |
| 35 } | 35 } |
| 36 | 36 |
| 37 std::string ManifestFeature::Parse(const DictionaryValue* value) { |
| 38 std::string error = SimpleFeature::Parse(value); |
| 39 if (!error.empty()) |
| 40 return error; |
| 41 |
| 42 if (extension_types()->empty()) { |
| 43 return name() + ": Manifest features must specify at least one " + |
| 44 "value for extension_types."; |
| 45 } |
| 46 |
| 47 if (!GetContexts()->empty()) |
| 48 return name() + ": Manifest features do not support contexts."; |
| 49 |
| 50 return ""; |
| 51 } |
| 52 |
| 37 } // namespace | 53 } // namespace |
| OLD | NEW |