| Index: chrome/browser/ui/views/elevation_icon_setter.cc
|
| diff --git a/chrome/browser/ui/views/elevation_icon_setter.cc b/chrome/browser/ui/views/elevation_icon_setter.cc
|
| index 99912883269f0eaf945133d24f2ba5d8491f0759..ccffcbe689cba7373154f52e96654470267f9b5a 100644
|
| --- a/chrome/browser/ui/views/elevation_icon_setter.cc
|
| +++ b/chrome/browser/ui/views/elevation_icon_setter.cc
|
| @@ -14,6 +14,7 @@
|
| #include "base/win/win_util.h"
|
| #include "base/win/windows_version.h"
|
| #include "ui/gfx/icon_util.h"
|
| +#include "ui/gfx/win/dpi.h"
|
| #endif
|
|
|
|
|
| @@ -71,8 +72,15 @@ ElevationIconSetter::~ElevationIconSetter() {
|
|
|
| void ElevationIconSetter::SetButtonIcon(scoped_ptr<SkBitmap> icon) {
|
| if (icon) {
|
| - button_->SetImage(views::Button::STATE_NORMAL,
|
| - gfx::ImageSkia::CreateFrom1xBitmap(*icon));
|
| + float device_scale_factor = 1.0f;
|
| +#if defined(OS_WIN)
|
| + // Windows gives us back a correctly-scaled image for the current DPI, so
|
| + // mark this image as having been scaled for the current DPI already.
|
| + device_scale_factor = gfx::GetDPIScale();
|
| +#endif
|
| + button_->SetImage(
|
| + views::Button::STATE_NORMAL,
|
| + gfx::ImageSkia(gfx::ImageSkiaRep(*icon, device_scale_factor)));
|
| button_->SizeToPreferredSize();
|
| if (button_->parent())
|
| button_->parent()->Layout();
|
|
|