Add ENABLE_MEDIA_ROUTER define to builds other than Android and iOS.
[chromium-blink-merge.git] / chrome / browser / extensions / api / developer_private / extension_info_generator.h
blob736acce7c22ea6789a08178d1d3b75e8e9949c03
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"
10 namespace content {
11 class BrowserContext;
14 namespace extensions {
15 class ErrorConsole;
16 class Extension;
17 class ExtensionPrefs;
18 class ExtensionSystem;
19 class WarningService;
21 // Generates the developerPrivate api's specification for ExtensionInfo.
22 class ExtensionInfoGenerator {
23 public:
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
35 // can be found.
36 scoped_ptr<api::developer_private::ExtensionInfo> CreateExtensionInfo(
37 const std::string& id);
39 // Returns a collection of ExtensionInfos, optionally including disabled and
40 // terminated.
41 ExtensionInfoList CreateExtensionsInfo(bool include_disabled,
42 bool include_terminated);
44 private:
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_