| 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 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 &(web_app->icons[0].data))) { | 811 &(web_app->icons[0].data))) { |
| 812 web_app->icons[0].url = GURL(); | 812 web_app->icons[0].url = GURL(); |
| 813 web_app->icons[0].width = web_app->icons[0].data.width(); | 813 web_app->icons[0].width = web_app->icons[0].data.width(); |
| 814 web_app->icons[0].height = web_app->icons[0].data.height(); | 814 web_app->icons[0].height = web_app->icons[0].data.height(); |
| 815 } else { | 815 } else { |
| 816 web_app->icons.clear(); | 816 web_app->icons.clear(); |
| 817 } | 817 } |
| 818 | 818 |
| 819 scoped_refptr<CrxInstaller> installer( | 819 scoped_refptr<CrxInstaller> installer( |
| 820 CrxInstaller::Create(extension_service_, NULL)); | 820 CrxInstaller::Create(extension_service_, NULL)); |
| 821 installer->set_error_on_unsupported_requirements(true); |
| 821 installer->set_page_ordinal(install_info->page_ordinal); | 822 installer->set_page_ordinal(install_info->page_ordinal); |
| 822 installer->InstallWebApp(*web_app); | 823 installer->InstallWebApp(*web_app); |
| 823 attempted_bookmark_app_install_ = true; | 824 attempted_bookmark_app_install_ = true; |
| 824 } | 825 } |
| 825 | 826 |
| 826 void AppLauncherHandler::SetAppToBeHighlighted() { | 827 void AppLauncherHandler::SetAppToBeHighlighted() { |
| 827 if (highlight_app_id_.empty()) | 828 if (highlight_app_id_.empty()) |
| 828 return; | 829 return; |
| 829 | 830 |
| 830 StringValue app_id(highlight_app_id_); | 831 StringValue app_id(highlight_app_id_); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 997 | 998 |
| 998 void AppLauncherHandler::UninstallDefaultApps() { | 999 void AppLauncherHandler::UninstallDefaultApps() { |
| 999 AppsPromo* apps_promo = extension_service_->apps_promo(); | 1000 AppsPromo* apps_promo = extension_service_->apps_promo(); |
| 1000 const extensions::ExtensionIdSet& app_ids = apps_promo->old_default_apps(); | 1001 const extensions::ExtensionIdSet& app_ids = apps_promo->old_default_apps(); |
| 1001 for (extensions::ExtensionIdSet::const_iterator iter = app_ids.begin(); | 1002 for (extensions::ExtensionIdSet::const_iterator iter = app_ids.begin(); |
| 1002 iter != app_ids.end(); ++iter) { | 1003 iter != app_ids.end(); ++iter) { |
| 1003 if (extension_service_->GetExtensionById(*iter, true)) | 1004 if (extension_service_->GetExtensionById(*iter, true)) |
| 1004 extension_service_->UninstallExtension(*iter, false, NULL); | 1005 extension_service_->UninstallExtension(*iter, false, NULL); |
| 1005 } | 1006 } |
| 1006 } | 1007 } |
| OLD | NEW |