| 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..0c30fd61bafae3938f0b256afbb77feef18926f5 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,32 @@ ExtensionInfoGenerator::CreateExtensionInfo(const Extension& extension,
|
| return info.Pass();
|
| }
|
|
|
| +scoped_ptr<api::developer_private::ExtensionInfo>
|
| +ExtensionInfoGenerator::CreateExtensionInfo(const std::string& id) {
|
| + ExtensionRegistry* registry = ExtensionRegistry::Get(browser_context_);
|
| +
|
| + const Extension* enabled = registry->enabled_extensions().GetByID(id);
|
| + if (enabled &&
|
| + ui_util::ShouldDisplayInExtensionSettings(enabled, browser_context_)) {
|
| + return CreateExtensionInfo(*enabled, developer::EXTENSION_STATE_ENABLED);
|
| + }
|
| +
|
| + const Extension* disabled = registry->disabled_extensions().GetByID(id);
|
| + if (disabled &&
|
| + ui_util::ShouldDisplayInExtensionSettings(disabled, browser_context_)) {
|
| + return CreateExtensionInfo(*disabled, developer::EXTENSION_STATE_DISABLED);
|
| + }
|
| +
|
| + const Extension* terminated = registry->terminated_extensions().GetByID(id);
|
| + if (terminated &&
|
| + ui_util::ShouldDisplayInExtensionSettings(terminated, browser_context_)) {
|
| + return CreateExtensionInfo(*terminated,
|
| + developer::EXTENSION_STATE_TERMINATED);
|
| + }
|
| +
|
| + return scoped_ptr<api::developer_private::ExtensionInfo>();
|
| +}
|
| +
|
| ExtensionInfoGenerator::ExtensionInfoList
|
| ExtensionInfoGenerator::CreateExtensionsInfo(bool include_disabled,
|
| bool include_terminated) {
|
|
|