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

Unified Diff: chrome/common/extensions/api/extension_api_feature.h

Issue 10025007: Convert tabs, windows, and extension APIs to feature system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: blah Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
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_
« no previous file with comments | « chrome/common/extensions/api/extension_api.cc ('k') | chrome/common/extensions/api/extension_api_feature.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698