Chromium Code Reviews| 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_ |