Commit e4503ac4 authored by gbillock@chromium.org's avatar gbillock@chromium.org

Fix JS to pass through drop data from bookmark bar. Don't put

in any blank icons if none can be found.

R=estade@chromium.org
BUG=92073
TEST=none


Review URL: http://codereview.chromium.org/7600010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96037 0039d316-1c4b-4281-b951-d872f2087c98
parent 3fe8f0af
...@@ -701,10 +701,6 @@ void AppLauncherHandler::HandleGenerateAppForLink(const ListValue* args) { ...@@ -701,10 +701,6 @@ void AppLauncherHandler::HandleGenerateAppForLink(const ListValue* args) {
web_app->is_bookmark_app = true; web_app->is_bookmark_app = true;
web_app->title = title; web_app->title = title;
web_app->app_url = launch_url; web_app->app_url = launch_url;
WebApplicationInfo::IconInfo icon;
icon.url = GURL();
icon.width = icon.height = 16;
web_app->icons.push_back(icon);
Profile* profile = web_ui_->GetProfile(); Profile* profile = web_ui_->GetProfile();
FaviconService* favicon_service = FaviconService* favicon_service =
...@@ -741,13 +737,16 @@ void AppLauncherHandler::OnFaviconForApp(FaviconService::Handle handle, ...@@ -741,13 +737,16 @@ void AppLauncherHandler::OnFaviconForApp(FaviconService::Handle handle,
history::FaviconData data) { history::FaviconData data) {
scoped_ptr<WebApplicationInfo> web_app( scoped_ptr<WebApplicationInfo> web_app(
favicon_consumer_.GetClientDataForCurrentRequest()); favicon_consumer_.GetClientDataForCurrentRequest());
CHECK(!web_app->icons.empty()); WebApplicationInfo::IconInfo icon;
web_app->icons.push_back(icon);
if (data.is_valid() && gfx::PNGCodec::Decode(data.image_data->front(), if (data.is_valid() && gfx::PNGCodec::Decode(data.image_data->front(),
data.image_data->size(), data.image_data->size(),
&(web_app->icons[0].data))) { &(web_app->icons[0].data))) {
web_app->icons[0].url = GURL(); web_app->icons[0].url = GURL();
web_app->icons[0].width = web_app->icons[0].data.width(); web_app->icons[0].width = web_app->icons[0].data.width();
web_app->icons[0].height = web_app->icons[0].data.height(); web_app->icons[0].height = web_app->icons[0].data.height();
} else {
web_app->icons.clear();
} }
scoped_refptr<CrxInstaller> installer( scoped_refptr<CrxInstaller> installer(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment