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 #ifndef EXTENSIONS_COMMON_FEATURE_JSON_FEATURE_PROVIDER_SOURCE_H_
6 #define EXTENSIONS_COMMON_FEATURE_JSON_FEATURE_PROVIDER_SOURCE_H_
8 #include "base/values.h"
10 namespace extensions {
12 // A JSONFeatureProviderSource loads JSON dictionary files that
14 class JSONFeatureProviderSource {
16 explicit JSONFeatureProviderSource(const std::string& name);
17 ~JSONFeatureProviderSource();
19 // Adds the JSON dictionary file to this provider, merging its values with
20 // the current dictionary. Key collisions are treated as errors.
21 void LoadJSON(int resource_id);
23 // Returns the parsed dictionary.
24 const base::DictionaryValue& dictionary() { return dictionary_; }
27 // The name of this feature type; only used for debugging.
28 const std::string name_;
30 base::DictionaryValue dictionary_;
32 DISALLOW_COPY_AND_ASSIGN(JSONFeatureProviderSource);
35 } // namespace extensions
37 #endif // EXTENSIONS_COMMON_FEATURE_JSON_FEATURE_PROVIDER_SOURCE_H_