Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(360)

Side by Side Diff: chrome/browser/ui/webui/ntp/app_launcher_handler.cc

Issue 10689097: Enforce the 'requirements' field in manifests. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698