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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_EXTENSION_INFO_GENERATOR_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_EXTENSION_INFO_GENERATOR_H_
8 #include "chrome/common/extensions/api/developer_private.h"
14 namespace extensions
{
18 class ExtensionSystem
;
21 // Generates the developerPrivate api's specification for ExtensionInfo.
22 class ExtensionInfoGenerator
{
24 using ExtensionInfoList
=
25 std::vector
<linked_ptr
<api::developer_private::ExtensionInfo
>>;
27 explicit ExtensionInfoGenerator(content::BrowserContext
* context
);
28 ~ExtensionInfoGenerator();
30 // Returns the ExtensionInfo for a given |extension| and |state|.
31 scoped_ptr
<api::developer_private::ExtensionInfo
> CreateExtensionInfo(
32 const Extension
& extension
,
33 api::developer_private::ExtensionState state
);
34 // Returns an ExtensionInfo for the given |extension_id|, if the extension
36 scoped_ptr
<api::developer_private::ExtensionInfo
> CreateExtensionInfo(
37 const std::string
& id
);
39 // Returns a collection of ExtensionInfos, optionally including disabled and
41 ExtensionInfoList
CreateExtensionsInfo(bool include_disabled
,
42 bool include_terminated
);
45 // Various systems, cached for convenience.
46 content::BrowserContext
* browser_context_
;
47 ExtensionSystem
* extension_system_
;
48 ExtensionPrefs
* extension_prefs_
;
49 WarningService
* warning_service_
;
50 ErrorConsole
* error_console_
;
52 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoGenerator
);
55 } // namespace extensions
57 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_EXTENSION_INFO_GENERATOR_H_