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

Side by Side Diff: chrome/browser/extensions/app_shortcut_manager.cc

Issue 10701087: chromeos: Fix pixelated icons in app list and launcher (part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address oshima's comments from http://codereview.chromium.org/10699065/ Created 8 years, 5 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/extensions/app_shortcut_manager.h" 5 #include "chrome/browser/extensions/app_shortcut_manager.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/web_applications/web_app.h" 10 #include "chrome/browser/web_applications/web_app.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 shortcut_info_.create_on_desktop = true; 90 shortcut_info_.create_on_desktop = true;
91 shortcut_info_.profile_path = profile_->GetPath(); 91 shortcut_info_.profile_path = profile_->GetPath();
92 92
93 std::vector<ImageLoadingTracker::ImageInfo> info_list; 93 std::vector<ImageLoadingTracker::ImageInfo> info_list;
94 for (size_t i = 0; i < arraysize(kDesiredSizes); ++i) { 94 for (size_t i = 0; i < arraysize(kDesiredSizes); ++i) {
95 int size = kDesiredSizes[i]; 95 int size = kDesiredSizes[i];
96 ExtensionResource resource = extension->GetIconResource( 96 ExtensionResource resource = extension->GetIconResource(
97 size, ExtensionIconSet::MATCH_EXACTLY); 97 size, ExtensionIconSet::MATCH_EXACTLY);
98 if (!resource.empty()) { 98 if (!resource.empty()) {
99 info_list.push_back( 99 info_list.push_back(
100 ImageLoadingTracker::ImageInfo(resource, gfx::Size(size, size))); 100 ImageLoadingTracker::ImageInfo(resource,
101 gfx::Size(size, size),
102 ui::SCALE_FACTOR_NONE));
101 } 103 }
102 } 104 }
103 105
104 if (info_list.empty()) { 106 if (info_list.empty()) {
105 size_t i = arraysize(kDesiredSizes) - 1; 107 size_t i = arraysize(kDesiredSizes) - 1;
106 int size = kDesiredSizes[i]; 108 int size = kDesiredSizes[i];
107 109
108 // If there is no icon at the desired sizes, we will resize what we can get. 110 // If there is no icon at the desired sizes, we will resize what we can get.
109 // Making a large icon smaller is prefered to making a small icon larger, so 111 // Making a large icon smaller is prefered to making a small icon larger, so
110 // look for a larger icon first: 112 // look for a larger icon first:
111 ExtensionResource resource = extension->GetIconResource( 113 ExtensionResource resource = extension->GetIconResource(
112 size, ExtensionIconSet::MATCH_BIGGER); 114 size, ExtensionIconSet::MATCH_BIGGER);
113 if (resource.empty()) { 115 if (resource.empty()) {
114 resource = extension->GetIconResource( 116 resource = extension->GetIconResource(
115 size, ExtensionIconSet::MATCH_SMALLER); 117 size, ExtensionIconSet::MATCH_SMALLER);
116 } 118 }
117 info_list.push_back( 119 info_list.push_back(
118 ImageLoadingTracker::ImageInfo(resource, gfx::Size(size, size))); 120 ImageLoadingTracker::ImageInfo(resource,
121 gfx::Size(size, size),
122 ui::SCALE_FACTOR_NONE));
119 } 123 }
120 124
121 // |icon_resources| may still be empty at this point, in which case LoadImage 125 // |icon_resources| may still be empty at this point, in which case LoadImage
122 // will call the OnImageLoaded callback with an empty image and exit 126 // will call the OnImageLoaded callback with an empty image and exit
123 // immediately. 127 // immediately.
124 tracker_.LoadImages(extension, info_list, ImageLoadingTracker::DONT_CACHE); 128 tracker_.LoadImages(extension, info_list, ImageLoadingTracker::DONT_CACHE);
125 } 129 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/image_loading_tracker.h » ('j') | chrome/browser/extensions/image_loading_tracker.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698