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