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

Side by Side Diff: chrome/browser/extensions/api/management/chrome_management_api_delegate.cc

Issue 776903002: Cleanup: Remove some unneeded string allocations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix win Created 6 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/extensions/api/management/chrome_management_api_delegat e.h" 5 #include "chrome/browser/extensions/api/management/chrome_management_api_delegat e.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/extensions/bookmark_app_helper.h" 8 #include "chrome/browser/extensions/bookmark_app_helper.h"
9 #include "chrome/browser/extensions/chrome_extension_function_details.h" 9 #include "chrome/browser/extensions/chrome_extension_function_details.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 ChromeAppForLinkDelegate() {} 193 ChromeAppForLinkDelegate() {}
194 ~ChromeAppForLinkDelegate() override {} 194 ~ChromeAppForLinkDelegate() override {}
195 195
196 void OnFaviconForApp( 196 void OnFaviconForApp(
197 extensions::ManagementGenerateAppForLinkFunction* function, 197 extensions::ManagementGenerateAppForLinkFunction* function,
198 content::BrowserContext* context, 198 content::BrowserContext* context,
199 const std::string& title, 199 const std::string& title,
200 const GURL& launch_url, 200 const GURL& launch_url,
201 const favicon_base::FaviconImageResult& image_result) { 201 const favicon_base::FaviconImageResult& image_result) {
202 WebApplicationInfo web_app; 202 WebApplicationInfo web_app;
203 web_app.title = base::UTF8ToUTF16(std::string(title)); 203 web_app.title = base::UTF8ToUTF16(title);
204 web_app.app_url = launch_url; 204 web_app.app_url = launch_url;
205 205
206 if (!image_result.image.IsEmpty()) { 206 if (!image_result.image.IsEmpty()) {
207 WebApplicationInfo::IconInfo icon; 207 WebApplicationInfo::IconInfo icon;
208 icon.data = image_result.image.AsBitmap(); 208 icon.data = image_result.image.AsBitmap();
209 icon.width = icon.data.width(); 209 icon.width = icon.data.width();
210 icon.height = icon.data.height(); 210 icon.height = icon.data.height();
211 web_app.icons.push_back(icon); 211 web_app.icons.push_back(icon);
212 } 212 }
213 213
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 380
381 GURL ChromeManagementAPIDelegate::GetIconURL( 381 GURL ChromeManagementAPIDelegate::GetIconURL(
382 const extensions::Extension* extension, 382 const extensions::Extension* extension,
383 int icon_size, 383 int icon_size,
384 ExtensionIconSet::MatchType match, 384 ExtensionIconSet::MatchType match,
385 bool grayscale, 385 bool grayscale,
386 bool* exists) const { 386 bool* exists) const {
387 return extensions::ExtensionIconSource::GetIconURL(extension, icon_size, 387 return extensions::ExtensionIconSource::GetIconURL(extension, icon_size,
388 match, grayscale, exists); 388 match, grayscale, exists);
389 } 389 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698