| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 class ExtensionActionAPI; | 28 class ExtensionActionAPI; |
| 29 class ExtensionPrefs; | 29 class ExtensionPrefs; |
| 30 class ExtensionSystem; | 30 class ExtensionSystem; |
| 31 class ImageLoader; | 31 class ImageLoader; |
| 32 class WarningService; | 32 class WarningService; |
| 33 | 33 |
| 34 // Generates the developerPrivate api's specification for ExtensionInfo. | 34 // Generates the developerPrivate api's specification for ExtensionInfo. |
| 35 // This class is designed to only have one generation running at a time! | 35 // This class is designed to only have one generation running at a time! |
| 36 class ExtensionInfoGenerator { | 36 class ExtensionInfoGenerator { |
| 37 public: | 37 public: |
| 38 using ExtensionInfoList = | 38 using ExtensionInfoList = std::vector<api::developer_private::ExtensionInfo>; |
| 39 std::vector<linked_ptr<api::developer_private::ExtensionInfo>>; | |
| 40 | 39 |
| 41 using ExtensionInfosCallback = base::Callback<void(const ExtensionInfoList&)>; | 40 using ExtensionInfosCallback = base::Callback<void(ExtensionInfoList)>; |
| 42 | 41 |
| 43 explicit ExtensionInfoGenerator(content::BrowserContext* context); | 42 explicit ExtensionInfoGenerator(content::BrowserContext* context); |
| 44 ~ExtensionInfoGenerator(); | 43 ~ExtensionInfoGenerator(); |
| 45 | 44 |
| 46 // Creates and asynchronously returns an ExtensionInfo for the given | 45 // Creates and asynchronously returns an ExtensionInfo for the given |
| 47 // |extension_id|, if the extension can be found. | 46 // |extension_id|, if the extension can be found. |
| 48 // If the extension cannot be found, an empty vector is passed to |callback|. | 47 // If the extension cannot be found, an empty vector is passed to |callback|. |
| 49 void CreateExtensionInfo(const std::string& id, | 48 void CreateExtensionInfo(const std::string& id, |
| 50 const ExtensionInfosCallback& callback); | 49 const ExtensionInfosCallback& callback); |
| 51 | 50 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 ExtensionInfosCallback callback_; | 97 ExtensionInfosCallback callback_; |
| 99 | 98 |
| 100 base::WeakPtrFactory<ExtensionInfoGenerator> weak_factory_; | 99 base::WeakPtrFactory<ExtensionInfoGenerator> weak_factory_; |
| 101 | 100 |
| 102 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoGenerator); | 101 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoGenerator); |
| 103 }; | 102 }; |
| 104 | 103 |
| 105 } // namespace extensions | 104 } // namespace extensions |
| 106 | 105 |
| 107 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_EXTENSION_INFO_GENERA
TOR_H_ | 106 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_EXTENSION_INFO_GENERA
TOR_H_ |
| OLD | NEW |