diff options
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/extensions/extensions_ui.cc | 14 | ||||
-rw-r--r-- | chrome/browser/resources/extensions_ui.html | 15 |
2 files changed, 25 insertions, 4 deletions
diff --git a/chrome/browser/extensions/extensions_ui.cc b/chrome/browser/extensions/extensions_ui.cc index d85d654..3936b69 100644 --- a/chrome/browser/extensions/extensions_ui.cc +++ b/chrome/browser/extensions/extensions_ui.cc @@ -418,9 +418,19 @@ DictionaryValue* ExtensionsDOMHandler::CreateExtensionDetailValue( extension_data->SetString(L"description", extension->description()); extension_data->SetString(L"version", extension->version()->GetString()); extension_data->SetBoolean(L"enabled", enabled); - if (!extension->options_url().is_empty()) { + if (!extension->options_url().is_empty()) extension_data->SetString(L"options_url", extension->options_url().spec()); - } + + // Try to fetch the medium sized icon, then (if missing) go for the large one. + const std::map<int, std::string>& icons = extension->icons(); + std::map<int, std::string>::const_iterator iter = + icons.find(Extension::EXTENSION_ICON_MEDIUM); + if (iter == icons.end()) + iter = icons.find(Extension::EXTENSION_ICON_LARGE); + if (iter != icons.end()) + extension_data->SetString(L"icon", iter->second); + else + extension_data->SetString(L"icon", ""); // Add list of content_script detail DictionaryValues ListValue *content_script_list = new ListValue(); diff --git a/chrome/browser/resources/extensions_ui.html b/chrome/browser/resources/extensions_ui.html index 978edfc..fc63035 100644 --- a/chrome/browser/resources/extensions_ui.html +++ b/chrome/browser/resources/extensions_ui.html @@ -229,6 +229,7 @@ var extensionDataFormat = { "version": "1.0.231", "enabled": "true", "options_url": "options.html", + "icon": "relative-path-to-icon.png", "content_scripts": [ { "js": ["script1_file1.js", "script1_file2.js"], @@ -264,6 +265,7 @@ var extensionDataFormat = { "description": "Extension long format description", "version": "1.0.231", "enabled": "true", + "icon": "", "content_scripts": [ { "js": ["script1_file1.js", "script1_file2.js"], @@ -574,8 +576,17 @@ function autoUpdate() { <div class="extension" jsselect="extensions"> <table width="100%" cellpadding="0" cellspacing="0"> <tr> - <td width="62" align="center" valign="top"><img width="48" height="48" - src="../../app/theme/infobar_plugin.png" /></td> + <td width="62" align="center" valign="top"> + <span jsdisplay="icon" + ><img + jsvalues=".src:'chrome-extension://' + id + '/' + icon" + width="48" height="48" /> + </span> + <span jsdisplay="icon == ''" + ><img + width="48" height="48" + src="../../app/theme/infobar_plugin.png" /></span> + </td> <td valign="top"> <div> <span class="extension-name" |