| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 data.image_data->size(), | 870 data.image_data->size(), |
| 871 &(web_app->icons[0].data))) { | 871 &(web_app->icons[0].data))) { |
| 872 web_app->icons[0].url = GURL(); | 872 web_app->icons[0].url = GURL(); |
| 873 web_app->icons[0].width = web_app->icons[0].data.width(); | 873 web_app->icons[0].width = web_app->icons[0].data.width(); |
| 874 web_app->icons[0].height = web_app->icons[0].data.height(); | 874 web_app->icons[0].height = web_app->icons[0].data.height(); |
| 875 } else { | 875 } else { |
| 876 web_app->icons.clear(); | 876 web_app->icons.clear(); |
| 877 } | 877 } |
| 878 | 878 |
| 879 scoped_refptr<CrxInstaller> installer( | 879 scoped_refptr<CrxInstaller> installer( |
| 880 extension_service_->MakeCrxInstaller(NULL)); | 880 CrxInstaller::Create(extension_service_, NULL)); |
| 881 installer->set_page_index(install_info->page_index); | 881 installer->set_page_index(install_info->page_index); |
| 882 installer->InstallWebApp(*web_app); | 882 installer->InstallWebApp(*web_app); |
| 883 attempted_bookmark_app_install_ = true; | 883 attempted_bookmark_app_install_ = true; |
| 884 } | 884 } |
| 885 | 885 |
| 886 void AppLauncherHandler::SetAppToBeHighlighted() { | 886 void AppLauncherHandler::SetAppToBeHighlighted() { |
| 887 if (highlight_app_id_.empty()) | 887 if (highlight_app_id_.empty()) |
| 888 return; | 888 return; |
| 889 | 889 |
| 890 StringValue app_id(highlight_app_id_); | 890 StringValue app_id(highlight_app_id_); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1053 | 1053 |
| 1054 void AppLauncherHandler::UninstallDefaultApps() { | 1054 void AppLauncherHandler::UninstallDefaultApps() { |
| 1055 AppsPromo* apps_promo = extension_service_->apps_promo(); | 1055 AppsPromo* apps_promo = extension_service_->apps_promo(); |
| 1056 const ExtensionIdSet& app_ids = apps_promo->old_default_apps(); | 1056 const ExtensionIdSet& app_ids = apps_promo->old_default_apps(); |
| 1057 for (ExtensionIdSet::const_iterator iter = app_ids.begin(); | 1057 for (ExtensionIdSet::const_iterator iter = app_ids.begin(); |
| 1058 iter != app_ids.end(); ++iter) { | 1058 iter != app_ids.end(); ++iter) { |
| 1059 if (extension_service_->GetExtensionById(*iter, true)) | 1059 if (extension_service_->GetExtensionById(*iter, true)) |
| 1060 extension_service_->UninstallExtension(*iter, false, NULL); | 1060 extension_service_->UninstallExtension(*iter, false, NULL); |
| 1061 } | 1061 } |
| 1062 } | 1062 } |
| OLD | NEW |