OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 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. | |
4 | |
5 #ifndef CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_ | |
6 #define CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_ | |
7 #pragma once | |
8 | |
9 #include <string> | |
10 | |
11 #include "base/basictypes.h" | |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "base/memory/singleton.h" | |
14 | |
15 namespace base { | |
16 class DictionaryValue; | |
17 class ListValue; | |
18 } | |
19 | |
20 namespace extensions { | |
21 | |
22 class ExtensionAPI { | |
Matt Perry
2011/11/11 20:07:19
please add a class comment
Aaron Boodman
2011/11/11 23:12:02
Done.
| |
23 public: | |
24 static ExtensionAPI* GetInstance(); | |
25 | |
26 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
| |
27 | |
28 private: | |
29 friend struct DefaultSingletonTraits<ExtensionAPI>; | |
30 | |
31 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.
| |
32 | |
33 base::DictionaryValue* FindListItem(base::ListValue* list, | |
34 const std::string& property_name, | |
35 const std::string& property_value) const; | |
36 | |
37 bool IsChildNameUnprivileged(base::DictionaryValue* namespace_node, | |
38 const std::string& child_kind, | |
39 const std::string& child_name) const; | |
40 | |
41 static ExtensionAPI* instance_; | |
42 | |
43 scoped_ptr<base::ListValue> value_; | |
44 | |
45 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); | |
46 }; | |
47 | |
48 } // extensions | |
49 | |
50 #endif // CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_ | |
OLD | NEW |