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