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

Unified Diff: ui/gfx/image/image_skia.cc

Issue 1025513004: Ensure that the extension icons show up in the omnibox at fractional scales. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unsupported image scales from the ImageSkia cache when we receive the OnImageLoaded notifica… Created 5 years, 9 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 | « ui/gfx/image/image_skia.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/image/image_skia.cc
diff --git a/ui/gfx/image/image_skia.cc b/ui/gfx/image/image_skia.cc
index 5e4410ad75b92d00fd7a8678b2cc375ab743b1f1..201bff0ffd8d58adc42f8767dc20084f1aa0f0ad 100644
--- a/ui/gfx/image/image_skia.cc
+++ b/ui/gfx/image/image_skia.cc
@@ -317,6 +317,13 @@ ImageSkia ImageSkia::CreateFrom1xBitmap(const SkBitmap& bitmap) {
return ImageSkia(ImageSkiaRep(bitmap, 0.0f));
}
+// static
+bool ImageSkia::IsSupportedScale(float scale) {
oshima 2015/03/24 21:57:01 can you move this to ui/base/layout.h ?
ananta 2015/03/24 23:11:56 Done.
+ const std::vector<float>& supported_scales = GetSupportedScales();
+ return std::find(supported_scales.begin(), supported_scales.end(), scale)
+ != supported_scales.end();
+}
+
scoped_ptr<ImageSkia> ImageSkia::DeepCopy() const {
ImageSkia* copy = new ImageSkia;
if (isNull())
« no previous file with comments | « ui/gfx/image/image_skia.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698