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

Unified Diff: chrome/browser/shell_integration_linux.cc

Issue 9586018: Add support for multiple icon sizes for Mac platform apps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix build Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/shell_integration.h ('k') | chrome/browser/ui/cocoa/extensions/browser_action_button.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/shell_integration_linux.cc
diff --git a/chrome/browser/shell_integration_linux.cc b/chrome/browser/shell_integration_linux.cc
index 574bd09382209dcb6ab52d143c6702f6da0f28e6..d351c35caf4440b144a5736cedbbc8a022e6b105 100644
--- a/chrome/browser/shell_integration_linux.cc
+++ b/chrome/browser/shell_integration_linux.cc
@@ -73,7 +73,7 @@ bool LaunchXdgUtility(const std::vector<std::string>& argv, int* exit_code) {
std::string CreateShortcutIcon(
const ShellIntegration::ShortcutInfo& shortcut_info,
const FilePath& shortcut_filename) {
- if (shortcut_info.favicon.isNull())
+ if (shortcut_info.favicon.IsEmpty())
return std::string();
// TODO(phajdan.jr): Report errors from this function, possibly as infobars.
@@ -85,7 +85,8 @@ std::string CreateShortcutIcon(
shortcut_filename.ReplaceExtension("png"));
std::vector<unsigned char> png_data;
- gfx::PNGCodec::EncodeBGRASkBitmap(shortcut_info.favicon, false, &png_data);
+ const SkBitmap* bitmap = shortcut_info.favicon.ToSkBitmap();
+ gfx::PNGCodec::EncodeBGRASkBitmap(*bitmap, false, &png_data);
int bytes_written = file_util::WriteFile(temp_file_path,
reinterpret_cast<char*>(png_data.data()), png_data.size());
@@ -102,7 +103,7 @@ std::string CreateShortcutIcon(
argv.push_back("user");
argv.push_back("--size");
- argv.push_back(base::IntToString(shortcut_info.favicon.width()));
+ argv.push_back(base::IntToString(bitmap->width()));
argv.push_back(temp_file_path.value());
std::string icon_name = temp_file_path.BaseName().RemoveExtension().value();
« no previous file with comments | « chrome/browser/shell_integration.h ('k') | chrome/browser/ui/cocoa/extensions/browser_action_button.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698