OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_ |
6 #define CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_ | 6 #define CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class DictionaryValue; | 16 class DictionaryValue; |
17 class ListValue; | 17 class ListValue; |
18 } | 18 } |
19 | 19 |
20 namespace extensions { | 20 namespace extensions { |
21 | 21 |
22 // C++ Wrapper for the extension_api.json file. | 22 // C++ Wrapper for the JSON API definitions in chrome/common/extensions/api/. |
23 class ExtensionAPI { | 23 class ExtensionAPI { |
24 public: | 24 public: |
25 // Returns the single instance of this class. | 25 // Returns the single instance of this class. |
26 static ExtensionAPI* GetInstance(); | 26 static ExtensionAPI* GetInstance(); |
27 | 27 |
28 const base::ListValue* value() const { | 28 const base::ListValue* value() const { |
29 return value_.get(); | 29 return value_.get(); |
30 } | 30 } |
31 | 31 |
32 // Returns ture if |name| is a privileged API. Privileged APIs can only be | 32 // Returns ture if |name| is a privileged API. Privileged APIs can only be |
(...skipping 24 matching lines...) Expand all Loading... |
57 static ExtensionAPI* instance_; | 57 static ExtensionAPI* instance_; |
58 | 58 |
59 scoped_ptr<base::ListValue> value_; | 59 scoped_ptr<base::ListValue> value_; |
60 | 60 |
61 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); | 61 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); |
62 }; | 62 }; |
63 | 63 |
64 } // extensions | 64 } // extensions |
65 | 65 |
66 #endif // CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_ | 66 #endif // CHROME_COMMON_EXTENSIONS_API_EXTENSION_API_H_ |
OLD | NEW |