Adding Peter Thatcher to the owners file.
[chromium-blink-merge.git] / extensions / common / features / api_feature.cc
blobe3e4c91b6db3796a5d548d38b6ef5bd9576fca3e
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "extensions/common/features/api_feature.h"
7 namespace extensions {
9 APIFeature::APIFeature()
10 : internal_(false) {}
12 APIFeature::~APIFeature() {
15 bool APIFeature::IsInternal() const {
16 return internal_;
19 std::string APIFeature::Parse(const base::DictionaryValue* value) {
20 std::string error = SimpleFeature::Parse(value);
21 if (!error.empty())
22 return error;
24 value->GetBoolean("internal", &internal_);
26 if (contexts()->empty())
27 return name() + ": API features must specify at least one context.";
29 return std::string();
32 } // namespace extensions