OLD | NEW |
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_icon_loader_impl.h" | 5 #include "chrome/browser/extensions/app_icon_loader_impl.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
9 #include "chrome/browser/extensions/extension_system.h" | 9 #include "chrome/browser/extensions/extension_system.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 extensions::IconsInfo::GetIcons(extension), | 60 extensions::IconsInfo::GetIcons(extension), |
61 icon_size_, | 61 icon_size_, |
62 extensions::IconsInfo::GetDefaultAppIcon(), | 62 extensions::IconsInfo::GetDefaultAppIcon(), |
63 this); | 63 this); |
64 // |map_| takes ownership of |image|. | 64 // |map_| takes ownership of |image|. |
65 map_[image] = id; | 65 map_[image] = id; |
66 | 66 |
67 // Triggers image loading now instead of depending on paint message. This | 67 // Triggers image loading now instead of depending on paint message. This |
68 // makes the temp blank image be shown for shorter time and improves user | 68 // makes the temp blank image be shown for shorter time and improves user |
69 // experience. See http://crbug.com/146114. | 69 // experience. See http://crbug.com/146114. |
70 image->image_skia().EnsureRepsForSupportedScales(); | 70 image->image_skia().EnsureRepsForSupportedScaleFactors(); |
71 } | 71 } |
72 | 72 |
73 void AppIconLoaderImpl::ClearImage(const std::string& id) { | 73 void AppIconLoaderImpl::ClearImage(const std::string& id) { |
74 for (ImageToExtensionIDMap::iterator i = map_.begin(); | 74 for (ImageToExtensionIDMap::iterator i = map_.begin(); |
75 i != map_.end(); ++i) { | 75 i != map_.end(); ++i) { |
76 if (i->second == id) { | 76 if (i->second == id) { |
77 delete i->first; | 77 delete i->first; |
78 map_.erase(i); | 78 map_.erase(i); |
79 break; | 79 break; |
80 } | 80 } |
(...skipping 28 matching lines...) Expand all Loading... |
109 const bool enabled = service->IsExtensionEnabledForLauncher(id); | 109 const bool enabled = service->IsExtensionEnabledForLauncher(id); |
110 if (!enabled) { | 110 if (!enabled) { |
111 const color_utils::HSL shift = {-1, 0, 0.6}; | 111 const color_utils::HSL shift = {-1, 0, 0.6}; |
112 image = gfx::ImageSkiaOperations::CreateHSLShiftedImage(image, shift); | 112 image = gfx::ImageSkiaOperations::CreateHSLShiftedImage(image, shift); |
113 } | 113 } |
114 | 114 |
115 delegate_->SetAppImage(id, image); | 115 delegate_->SetAppImage(id, image); |
116 } | 116 } |
117 | 117 |
118 } // namespace extensions | 118 } // namespace extensions |
OLD | NEW |