OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_EXTENSION_INFO_GENERATOR
_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_EXTENSION_INFO_GENERATOR
_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_EXTENSION_INFO_GENERATOR
_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_EXTENSION_INFO_GENERATOR
_H_ |
7 | 7 |
8 #include "chrome/common/extensions/api/developer_private.h" | 8 #include "chrome/common/extensions/api/developer_private.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
11 class BrowserContext; | 11 class BrowserContext; |
12 } | 12 } |
13 | 13 |
14 namespace extensions { | 14 namespace extensions { |
15 class ErrorConsole; | 15 class ErrorConsole; |
16 class Extension; | 16 class Extension; |
17 class ExtensionPrefs; | 17 class ExtensionPrefs; |
18 class ExtensionSystem; | 18 class ExtensionSystem; |
19 class WarningService; | 19 class WarningService; |
20 | 20 |
21 // Generates the developerPrivate api's specification for ExtensionInfo. | 21 // Generates the developerPrivate api's specification for ExtensionInfo. |
22 class ExtensionInfoGenerator { | 22 class ExtensionInfoGenerator { |
23 public: | 23 public: |
24 using ExtensionInfoList = | 24 using ExtensionInfoList = |
25 std::vector<linked_ptr<api::developer_private::ExtensionInfo>>; | 25 std::vector<linked_ptr<api::developer_private::ExtensionInfo>>; |
26 | 26 |
27 explicit ExtensionInfoGenerator(content::BrowserContext* context); | 27 explicit ExtensionInfoGenerator(content::BrowserContext* context); |
28 ~ExtensionInfoGenerator(); | 28 ~ExtensionInfoGenerator(); |
29 | 29 |
30 // Return the ExtensionInfo for a given |extension| and |state|. | 30 // Returns the ExtensionInfo for a given |extension| and |state|. |
31 scoped_ptr<api::developer_private::ExtensionInfo> CreateExtensionInfo( | 31 scoped_ptr<api::developer_private::ExtensionInfo> CreateExtensionInfo( |
32 const Extension& extension, | 32 const Extension& extension, |
33 api::developer_private::ExtensionState state); | 33 api::developer_private::ExtensionState state); |
| 34 // Returns an ExtensionInfo for the given |extension_id|, if the extension |
| 35 // can be found. |
| 36 scoped_ptr<api::developer_private::ExtensionInfo> CreateExtensionInfo( |
| 37 const std::string& id); |
34 | 38 |
35 // Return a collection of ExtensionInfos, optionally including disabled and | 39 // Returns a collection of ExtensionInfos, optionally including disabled and |
36 // terminated. | 40 // terminated. |
37 ExtensionInfoList CreateExtensionsInfo(bool include_disabled, | 41 ExtensionInfoList CreateExtensionsInfo(bool include_disabled, |
38 bool include_terminated); | 42 bool include_terminated); |
39 | 43 |
40 private: | 44 private: |
41 // Various systems, cached for convenience. | 45 // Various systems, cached for convenience. |
42 content::BrowserContext* browser_context_; | 46 content::BrowserContext* browser_context_; |
43 ExtensionSystem* extension_system_; | 47 ExtensionSystem* extension_system_; |
44 ExtensionPrefs* extension_prefs_; | 48 ExtensionPrefs* extension_prefs_; |
45 WarningService* warning_service_; | 49 WarningService* warning_service_; |
46 ErrorConsole* error_console_; | 50 ErrorConsole* error_console_; |
47 | 51 |
48 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoGenerator); | 52 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoGenerator); |
49 }; | 53 }; |
50 | 54 |
51 } // namespace extensions | 55 } // namespace extensions |
52 | 56 |
53 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_EXTENSION_INFO_GENERA
TOR_H_ | 57 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_EXTENSION_INFO_GENERA
TOR_H_ |
OLD | NEW |