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

Side by Side Diff: extensions/common/features/api_feature.cc

Issue 2151583003: [Extensions] Add extension feature generation code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Dirk's Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 "extensions/common/features/api_feature.h" 5 #include "extensions/common/features/api_feature.h"
6 6
7 namespace extensions { 7 namespace extensions {
8 8
9 APIFeature::APIFeature() 9 APIFeature::APIFeature() {}
10 : internal_(false) {}
11 10
12 APIFeature::~APIFeature() { 11 APIFeature::~APIFeature() {
13 } 12 }
14 13
15 bool APIFeature::IsInternal() const {
16 return internal_;
17 }
18
19 std::string APIFeature::Parse(const base::DictionaryValue* value) { 14 std::string APIFeature::Parse(const base::DictionaryValue* value) {
20 std::string error = SimpleFeature::Parse(value); 15 std::string error = SimpleFeature::Parse(value);
21 if (!error.empty()) 16 if (!error.empty())
22 return error; 17 return error;
23 18
24 value->GetBoolean("internal", &internal_); 19 bool internal = false;
20 if (value->GetBoolean("internal", &internal))
21 set_internal(internal);
25 22
26 if (contexts()->empty()) 23 if (contexts().empty())
27 return name() + ": API features must specify at least one context."; 24 return name() + ": API features must specify at least one context.";
28 25
29 return std::string(); 26 return std::string();
30 } 27 }
31 28
32 } // namespace extensions 29 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698