Skip to content

Commit f94447b

Browse files
committed
Just use the image skia from resouce bundle for default app icon.
Another issue similar to 605884. BUG=614992 [email protected] Review-Url: https://codereview.chromium.org/2012273002 Cr-Commit-Position: refs/heads/master@{#397040} (cherry picked from commit b801ad2) Review URL: https://codereview.chromium.org/2034293002 . Cr-Commit-Position: refs/branch-heads/2743@{crosswalk-project#218} Cr-Branched-From: 2b3ae3b-refs/heads/master@{#394939}
1 parent 53a26bb commit f94447b

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

chrome/browser/extensions/extension_uninstall_dialog.cc

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,9 @@ const char kExtensionRemovedError[] =
4141

4242
const char kReferrerId[] = "chrome-remove-extension-dialog";
4343

44-
// Returns bitmap for the default icon with size equal to the default icon's
45-
// pixel size under maximal supported scale factor.
46-
SkBitmap GetDefaultIconBitmapForMaxScaleFactor(bool is_app) {
47-
const gfx::ImageSkia& image =
48-
is_app ? util::GetDefaultAppIcon() : util::GetDefaultExtensionIcon();
49-
return image.GetRepresentation(
50-
gfx::ImageSkia::GetMaxSupportedScale()).sk_bitmap();
44+
// Returns gfx::ImageSkia for the default icon.
45+
gfx::ImageSkia GetDefaultIconImage(bool is_app) {
46+
return is_app ? util::GetDefaultAppIcon() : util::GetDefaultExtensionIcon();
5147
}
5248

5349
} // namespace
@@ -107,13 +103,7 @@ void ExtensionUninstallDialog::ConfirmUninstall(
107103

108104
void ExtensionUninstallDialog::SetIcon(const gfx::Image& image) {
109105
if (image.IsEmpty()) {
110-
// Let's set default icon bitmap whose size is equal to the default icon's
111-
// pixel size under maximal supported scale factor. If the bitmap is larger
112-
// than the one we need, it will be scaled down by the ui code.
113-
// TODO(tbarzic): We should use IconImage here and load the required bitmap
114-
// lazily.
115-
icon_ = gfx::ImageSkia::CreateFrom1xBitmap(
116-
GetDefaultIconBitmapForMaxScaleFactor(extension_->is_app()));
106+
icon_ = GetDefaultIconImage(extension_->is_app());
117107
} else {
118108
icon_ = *image.ToImageSkia();
119109
}

0 commit comments

Comments
 (0)