OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/ui/app_list/arc/arc_app_icon.h" | 5 #include "chrome/browser/ui/app_list/arc/arc_app_icon.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
81 } | 81 } |
82 | 82 |
83 gfx::ImageSkiaRep ArcAppIcon::Source::GetImageForScale(float scale) { | 83 gfx::ImageSkiaRep ArcAppIcon::Source::GetImageForScale(float scale) { |
84 if (host_) | 84 if (host_) |
85 host_->LoadForScaleFactor(ui::GetSupportedScaleFactor(scale)); | 85 host_->LoadForScaleFactor(ui::GetSupportedScaleFactor(scale)); |
86 | 86 |
87 // Host loads icon asynchronously, so use default icon so far. | 87 // Host loads icon asynchronously, so use default icon so far. |
88 int resource_id; | 88 int resource_id; |
89 if (host_ && host_->app_id() == arc::kPlayStoreAppId) { | 89 if (host_ && host_->app_id() == arc::kPlayStoreAppId) { |
90 resource_id = scale >= 1.5f ? | 90 resource_id = scale >= 1.5f ? |
91 IDR_ARC_SUPPORT_ICON_48 : IDR_ARC_SUPPORT_ICON_96; | 91 IDR_ARC_SUPPORT_ICON_96 : IDR_ARC_SUPPORT_ICON_48; |
khmel
2016/09/23 01:44:45
could you please retest that it works as expected.
hshi1
2016/09/23 01:47:50
Yes I did just retest this (I'm using a paint tool
khmel
2016/09/23 01:48:54
Thanks, lgtm
| |
92 } else { | 92 } else { |
93 resource_id = IDR_APP_DEFAULT_ICON; | 93 resource_id = IDR_APP_DEFAULT_ICON; |
94 } | 94 } |
95 const gfx::ImageSkia* default_image = ResourceBundle::GetSharedInstance(). | 95 const gfx::ImageSkia* default_image = ResourceBundle::GetSharedInstance(). |
96 GetImageSkiaNamed(resource_id); | 96 GetImageSkiaNamed(resource_id); |
97 CHECK(default_image); | 97 CHECK(default_image); |
98 return gfx::ImageSkiaOperations::CreateResizedImage( | 98 return gfx::ImageSkiaOperations::CreateResizedImage( |
99 *default_image, | 99 *default_image, |
100 skia::ImageOperations::RESIZE_BEST, | 100 skia::ImageOperations::RESIZE_BEST, |
101 gfx::Size(resource_size_in_dip_, resource_size_in_dip_)). | 101 gfx::Size(resource_size_in_dip_, resource_size_in_dip_)). |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
306 | 306 |
307 void ArcAppIcon::DiscardDecodeRequest(DecodeRequest* request) { | 307 void ArcAppIcon::DiscardDecodeRequest(DecodeRequest* request) { |
308 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 308 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
309 | 309 |
310 ScopedVector<DecodeRequest>::iterator it = std::find(decode_requests_.begin(), | 310 ScopedVector<DecodeRequest>::iterator it = std::find(decode_requests_.begin(), |
311 decode_requests_.end(), | 311 decode_requests_.end(), |
312 request); | 312 request); |
313 CHECK(it != decode_requests_.end()); | 313 CHECK(it != decode_requests_.end()); |
314 decode_requests_.erase(it); | 314 decode_requests_.erase(it); |
315 } | 315 } |
OLD | NEW |