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

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

Issue 8540012: Enable extension APIs for content scripts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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.h
diff --git a/chrome/common/extensions/api/extension_api.h b/chrome/common/extensions/api/extension_api.h
new file mode 100644
index 0000000000000000000000000000000000000000..8e5fed90f418320a984c46463724373f1ed3e66d
--- /dev/null
+++ b/chrome/common/extensions/api/extension_api.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2011 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_H_
+#define CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_
+#pragma once
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/singleton.h"
+
+namespace base {
+class DictionaryValue;
+class ListValue;
+}
+
+namespace extensions {
+
+class ExtensionAPI {
Matt Perry 2011/11/11 20:07:19 please add a class comment
Aaron Boodman 2011/11/11 23:12:02 Done.
+ public:
+ static ExtensionAPI* GetInstance();
+
+ bool IsFullNameUnprivileged(const std::string& name) const;
Matt Perry 2011/11/11 20:07:19 some method comments too
Matt Perry 2011/11/11 20:07:19 this name leads to double negatives (i.e. !IsUnpri
Aaron Boodman 2011/11/11 23:12:02 Done.
Aaron Boodman 2011/11/11 23:12:02 Yeah, agree, but the default is privileged, so I t
Matt Perry 2011/11/11 23:35:24 meh, i don't think the default really matters to c
+
+ private:
+ friend struct DefaultSingletonTraits<ExtensionAPI>;
+
+ ExtensionAPI();
Matt Perry 2011/11/11 20:07:19 declare a destructor and implement it in the .cc f
Aaron Boodman 2011/11/11 23:12:02 Done.
+
+ base::DictionaryValue* FindListItem(base::ListValue* list,
+ const std::string& property_name,
+ const std::string& property_value) const;
+
+ bool IsChildNameUnprivileged(base::DictionaryValue* namespace_node,
+ const std::string& child_kind,
+ const std::string& child_name) const;
+
+ static ExtensionAPI* instance_;
+
+ scoped_ptr<base::ListValue> value_;
+
+ DISALLOW_COPY_AND_ASSIGN(ExtensionAPI);
+};
+
+} // extensions
+
+#endif // CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_

Powered by Google App Engine
This is Rietveld 408576698