| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" | 5 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 scoped_ptr<AppInstallInfo> install_info( | 787 scoped_ptr<AppInstallInfo> install_info( |
| 788 favicon_consumer_.GetClientDataForCurrentRequest()); | 788 favicon_consumer_.GetClientDataForCurrentRequest()); |
| 789 scoped_ptr<WebApplicationInfo> web_app(new WebApplicationInfo()); | 789 scoped_ptr<WebApplicationInfo> web_app(new WebApplicationInfo()); |
| 790 web_app->is_bookmark_app = install_info->is_bookmark_app; | 790 web_app->is_bookmark_app = install_info->is_bookmark_app; |
| 791 web_app->title = install_info->title; | 791 web_app->title = install_info->title; |
| 792 web_app->app_url = install_info->app_url; | 792 web_app->app_url = install_info->app_url; |
| 793 web_app->urls.push_back(install_info->app_url); | 793 web_app->urls.push_back(install_info->app_url); |
| 794 | 794 |
| 795 WebApplicationInfo::IconInfo icon; | 795 WebApplicationInfo::IconInfo icon; |
| 796 web_app->icons.push_back(icon); | 796 web_app->icons.push_back(icon); |
| 797 if (data.is_valid() && gfx::PNGCodec::Decode(data.image_data->front(), | 797 if (data.is_valid() && gfx::PNGCodec::Decode(data.bitmap_data->front(), |
| 798 data.image_data->size(), | 798 data.bitmap_data->size(), |
| 799 &(web_app->icons[0].data))) { | 799 &(web_app->icons[0].data))) { |
| 800 web_app->icons[0].url = GURL(); | 800 web_app->icons[0].url = GURL(); |
| 801 web_app->icons[0].width = web_app->icons[0].data.width(); | 801 web_app->icons[0].width = web_app->icons[0].data.width(); |
| 802 web_app->icons[0].height = web_app->icons[0].data.height(); | 802 web_app->icons[0].height = web_app->icons[0].data.height(); |
| 803 } else { | 803 } else { |
| 804 web_app->icons.clear(); | 804 web_app->icons.clear(); |
| 805 } | 805 } |
| 806 | 806 |
| 807 scoped_refptr<CrxInstaller> installer( | 807 scoped_refptr<CrxInstaller> installer( |
| 808 CrxInstaller::Create(extension_service_, NULL)); | 808 CrxInstaller::Create(extension_service_, NULL)); |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 985 | 985 |
| 986 void AppLauncherHandler::UninstallDefaultApps() { | 986 void AppLauncherHandler::UninstallDefaultApps() { |
| 987 AppsPromo* apps_promo = extension_service_->apps_promo(); | 987 AppsPromo* apps_promo = extension_service_->apps_promo(); |
| 988 const extensions::ExtensionIdSet& app_ids = apps_promo->old_default_apps(); | 988 const extensions::ExtensionIdSet& app_ids = apps_promo->old_default_apps(); |
| 989 for (extensions::ExtensionIdSet::const_iterator iter = app_ids.begin(); | 989 for (extensions::ExtensionIdSet::const_iterator iter = app_ids.begin(); |
| 990 iter != app_ids.end(); ++iter) { | 990 iter != app_ids.end(); ++iter) { |
| 991 if (extension_service_->GetExtensionById(*iter, true)) | 991 if (extension_service_->GetExtensionById(*iter, true)) |
| 992 extension_service_->UninstallExtension(*iter, false, NULL); | 992 extension_service_->UninstallExtension(*iter, false, NULL); |
| 993 } | 993 } |
| 994 } | 994 } |
| OLD | NEW |