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

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

Issue 7739007: ntp4: app generation tweak (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix for overlapping extents Created 9 years, 3 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
« no previous file with comments | « chrome/browser/resources/ntp4/apps_page.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 } 801 }
802 802
803 void AppLauncherHandler::OnFaviconForApp(FaviconService::Handle handle, 803 void AppLauncherHandler::OnFaviconForApp(FaviconService::Handle handle,
804 history::FaviconData data) { 804 history::FaviconData data) {
805 scoped_ptr<AppInstallInfo> install_info( 805 scoped_ptr<AppInstallInfo> install_info(
806 favicon_consumer_.GetClientDataForCurrentRequest()); 806 favicon_consumer_.GetClientDataForCurrentRequest());
807 scoped_ptr<WebApplicationInfo> web_app(new WebApplicationInfo()); 807 scoped_ptr<WebApplicationInfo> web_app(new WebApplicationInfo());
808 web_app->is_bookmark_app = install_info->is_bookmark_app; 808 web_app->is_bookmark_app = install_info->is_bookmark_app;
809 web_app->title = install_info->title; 809 web_app->title = install_info->title;
810 web_app->app_url = install_info->app_url; 810 web_app->app_url = install_info->app_url;
811 web_app->urls.push_back(install_info->app_url);
811 812
812 WebApplicationInfo::IconInfo icon; 813 WebApplicationInfo::IconInfo icon;
813 web_app->icons.push_back(icon); 814 web_app->icons.push_back(icon);
814 if (data.is_valid() && gfx::PNGCodec::Decode(data.image_data->front(), 815 if (data.is_valid() && gfx::PNGCodec::Decode(data.image_data->front(),
815 data.image_data->size(), 816 data.image_data->size(),
816 &(web_app->icons[0].data))) { 817 &(web_app->icons[0].data))) {
817 web_app->icons[0].url = GURL(); 818 web_app->icons[0].url = GURL();
818 web_app->icons[0].width = web_app->icons[0].data.width(); 819 web_app->icons[0].width = web_app->icons[0].data.width();
819 web_app->icons[0].height = web_app->icons[0].data.height(); 820 web_app->icons[0].height = web_app->icons[0].data.height();
820 } else { 821 } else {
(...skipping 174 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 ExtensionIdSet& app_ids = apps_promo->old_default_apps(); 999 const ExtensionIdSet& app_ids = apps_promo->old_default_apps();
999 for (ExtensionIdSet::const_iterator iter = app_ids.begin(); 1000 for (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/resources/ntp4/apps_page.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698