| Index: chrome/common/extensions/api/extension_api_feature.h
|
| diff --git a/chrome/common/extensions/api/extension_api_feature.h b/chrome/common/extensions/api/extension_api_feature.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c172c44331de44a66ba9ab16380a4e059e7dc3e3
|
| --- /dev/null
|
| +++ b/chrome/common/extensions/api/extension_api_feature.h
|
| @@ -0,0 +1,43 @@
|
| +// 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.
|
| +
|
| +#ifndef CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_FEATURE_H_
|
| +#define CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_FEATURE_H_
|
| +#pragma once
|
| +
|
| +#include "chrome/common/extensions/feature.h"
|
| +
|
| +#include <map>
|
| +#include <set>
|
| +#include "base/memory/linked_ptr.h"
|
| +
|
| +namespace extensions {
|
| +
|
| +class ExtensionAPIFeature : public Feature {
|
| + public:
|
| + ExtensionAPIFeature();
|
| + virtual ~ExtensionAPIFeature();
|
| +
|
| + std::set<std::string>* dependencies();
|
| +
|
| + virtual void Parse(const DictionaryValue* value) OVERRIDE;
|
| +
|
| + // Returns a child feature with the given name.
|
| + // TODO(aa): This will return NULL if the child is empty. It would be better
|
| + // to generate a feature on the fly for such children, but that will require
|
| + // reworking ownership a bit since callers currently do not expect to ever
|
| + // take ownership of the values returned here.
|
| + Feature* GetChild(const std::string& name) const;
|
| +
|
| + private:
|
| + std::set<std::string> dependencies_;
|
| +
|
| + typedef std::map<std::string,
|
| + linked_ptr<ExtensionAPIFeature> > ChildFeatureMap;
|
| + ChildFeatureMap child_features_;
|
| +};
|
| +
|
| +} // namespace extensions
|
| +
|
| +#endif // CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_FEATURE_H_
|
|
|