| Index: chrome/browser/dom_ui/app_launcher_handler.cc
|
| diff --git a/chrome/browser/dom_ui/app_launcher_handler.cc b/chrome/browser/dom_ui/app_launcher_handler.cc
|
| index 825be90933979400a4068fc0458c909fe339ea3d..5c317e9150748ddf38ccfd8b0906a677f2b04016 100644
|
| --- a/chrome/browser/dom_ui/app_launcher_handler.cc
|
| +++ b/chrome/browser/dom_ui/app_launcher_handler.cc
|
| @@ -38,6 +38,21 @@ bool ExtractInt(const ListValue* list, size_t index, int* out_int) {
|
| return false;
|
| }
|
|
|
| +std::string GetIconURL(Extension* extension, Extension::Icons icon,
|
| + const std::string& default_val) {
|
| + ExtensionResource resource = extension->GetIconPath(icon);
|
| + if (resource.empty())
|
| + return default_val;
|
| +
|
| +#if defined(OS_POSIX)
|
| + std::string path = resource.relative_path().value();
|
| +#elif defined(OS_WIN)
|
| + std::string path = WideToUTF8(resource.relative_path().value());
|
| +#endif // OS_WIN
|
| +
|
| + return extension->GetResourceURL(path).spec();
|
| +}
|
| +
|
| } // namespace
|
|
|
| AppLauncherHandler::AppLauncherHandler(ExtensionsService* extension_service)
|
| @@ -85,17 +100,13 @@ void AppLauncherHandler::CreateAppInfo(Extension* extension,
|
| value->SetString("launch_url", extension->GetFullLaunchURL().spec());
|
| value->SetString("options_url", extension->options_url().spec());
|
|
|
| - FilePath relative_path =
|
| - extension->GetIconPath(Extension::EXTENSION_ICON_LARGE).relative_path();
|
| -
|
| -#if defined(OS_POSIX)
|
| - std::string path = relative_path.value();
|
| -#elif defined(OS_WIN)
|
| - std::string path = WideToUTF8(relative_path.value());
|
| -#endif // OS_WIN
|
| -
|
| - GURL icon_url = extension->GetResourceURL(path);
|
| - value->SetString("icon", icon_url.spec());
|
| + // TODO(aa): Need a better default icon for apps.
|
| + value->SetString("icon_big", GetIconURL(
|
| + extension, Extension::EXTENSION_ICON_LARGE,
|
| + "chrome://theme/IDR_EXTENSION_DEFAULT_ICON"));
|
| + value->SetString("icon_small", GetIconURL(
|
| + extension, Extension::EXTENSION_ICON_BITTY,
|
| + std::string("chrome://favicon/") + extension->GetFullLaunchURL().spec()));
|
| }
|
|
|
| void AppLauncherHandler::HandleGetApps(const ListValue* args) {
|
|
|