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

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

Issue 10821035: wip Base URL: svn://svn.chromium.org/chrome/trunk/src
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 | Annotate | Revision Log
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 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 scoped_ptr<AppInstallInfo> install_info( 797 scoped_ptr<AppInstallInfo> install_info(
798 favicon_consumer_.GetClientDataForCurrentRequest()); 798 favicon_consumer_.GetClientDataForCurrentRequest());
799 scoped_ptr<WebApplicationInfo> web_app(new WebApplicationInfo()); 799 scoped_ptr<WebApplicationInfo> web_app(new WebApplicationInfo());
800 web_app->is_bookmark_app = install_info->is_bookmark_app; 800 web_app->is_bookmark_app = install_info->is_bookmark_app;
801 web_app->title = install_info->title; 801 web_app->title = install_info->title;
802 web_app->app_url = install_info->app_url; 802 web_app->app_url = install_info->app_url;
803 web_app->urls.push_back(install_info->app_url); 803 web_app->urls.push_back(install_info->app_url);
804 804
805 WebApplicationInfo::IconInfo icon; 805 WebApplicationInfo::IconInfo icon;
806 web_app->icons.push_back(icon); 806 web_app->icons.push_back(icon);
807 if (data.is_valid() && gfx::PNGCodec::Decode(data.bitmap_data->front(), 807 if (data.is_valid() && data.variants.size() > 0 &&
808 data.bitmap_data->size(), 808 gfx::PNGCodec::Decode(data.variants[0].bitmap_data->front(),
809 &(web_app->icons[0].data))) { 809 data.variants[0].bitmap_data->size(),
810 &(web_app->icons[0].data))) {
810 web_app->icons[0].url = GURL(); 811 web_app->icons[0].url = GURL();
811 web_app->icons[0].width = web_app->icons[0].data.width(); 812 web_app->icons[0].width = web_app->icons[0].data.width();
812 web_app->icons[0].height = web_app->icons[0].data.height(); 813 web_app->icons[0].height = web_app->icons[0].data.height();
813 } else { 814 } else {
814 web_app->icons.clear(); 815 web_app->icons.clear();
815 } 816 }
816 817
817 scoped_refptr<CrxInstaller> installer( 818 scoped_refptr<CrxInstaller> installer(
818 CrxInstaller::Create(extension_service_, NULL)); 819 CrxInstaller::Create(extension_service_, NULL));
819 installer->set_page_ordinal(install_info->page_ordinal); 820 installer->set_page_ordinal(install_info->page_ordinal);
(...skipping 175 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
« no previous file with comments | « chrome/browser/ui/webui/favicon_source.cc ('k') | chrome/browser/ui/webui/ntp/favicon_webui_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698