| Index: chrome/browser/extensions/api/developer_private/extension_info_generator.cc
|
| diff --git a/chrome/browser/extensions/api/developer_private/extension_info_generator.cc b/chrome/browser/extensions/api/developer_private/extension_info_generator.cc
|
| index 81bf3a5684a2079847a541afb504588a20ea87d3..45817278c2fdf3e0cba2b89eab9b35f1034a416c 100644
|
| --- a/chrome/browser/extensions/api/developer_private/extension_info_generator.cc
|
| +++ b/chrome/browser/extensions/api/developer_private/extension_info_generator.cc
|
| @@ -71,8 +71,7 @@ developer::ExtensionType GetExtensionType(Manifest::Type manifest_type) {
|
|
|
| // Populates the common fields of an extension error.
|
| template <typename ErrorType>
|
| -void PopulateErrorBase(const ExtensionError& error,
|
| - ErrorType* out) {
|
| +void PopulateErrorBase(const ExtensionError& error, ErrorType* out) {
|
| CHECK(out);
|
| out->type = error.type() == ExtensionError::MANIFEST_ERROR ?
|
| developer::ERROR_TYPE_MANIFEST : developer::ERROR_TYPE_RUNTIME;
|
| @@ -365,6 +364,25 @@ ExtensionInfoGenerator::CreateExtensionInfo(const Extension& extension,
|
| return info.Pass();
|
| }
|
|
|
| +scoped_ptr<api::developer_private::ExtensionInfo>
|
| +ExtensionInfoGenerator::CreateExtensionInfo(const std::string& id) {
|
| + developer::ExtensionState state = developer::EXTENSION_STATE_ENABLED;
|
| + ExtensionRegistry* registry = ExtensionRegistry::Get(browser_context_);
|
| + const Extension* extension = registry->enabled_extensions().GetByID(id);
|
| + if (!extension &&
|
| + (extension = registry->disabled_extensions().GetByID(id)) != nullptr) {
|
| + state = developer::EXTENSION_STATE_DISABLED;
|
| + } else if (!extension &&
|
| + (extension =
|
| + registry->terminated_extensions().GetByID(id)) != nullptr) {
|
| + state = developer::EXTENSION_STATE_TERMINATED;
|
| + }
|
| + scoped_ptr<api::developer_private::ExtensionInfo> info;
|
| + if (extension)
|
| + info = CreateExtensionInfo(*extension, state);
|
| + return info.Pass();
|
| +}
|
| +
|
| ExtensionInfoGenerator::ExtensionInfoList
|
| ExtensionInfoGenerator::CreateExtensionsInfo(bool include_disabled,
|
| bool include_terminated) {
|
|
|