| 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/ui/webui/extensions/extension_icon_source.h" | 5 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 | 140 |
| 141 if (icon.relative_path().empty()) { | 141 if (icon.relative_path().empty()) { |
| 142 LoadIconFailed(next_id); | 142 LoadIconFailed(next_id); |
| 143 } else { | 143 } else { |
| 144 LoadExtensionImage(icon, next_id); | 144 LoadExtensionImage(icon, next_id); |
| 145 } | 145 } |
| 146 } | 146 } |
| 147 | 147 |
| 148 ExtensionIconSource::~ExtensionIconSource() { | 148 ExtensionIconSource::~ExtensionIconSource() { |
| 149 // Clean up all the temporary data we're holding for requests. | 149 // Clean up all the temporary data we're holding for requests. |
| 150 STLDeleteValues(&request_map_); | 150 base::STLDeleteValues(&request_map_); |
| 151 } | 151 } |
| 152 | 152 |
| 153 const SkBitmap* ExtensionIconSource::GetDefaultAppImage() { | 153 const SkBitmap* ExtensionIconSource::GetDefaultAppImage() { |
| 154 if (!default_app_data_.get()) | 154 if (!default_app_data_.get()) |
| 155 default_app_data_.reset(LoadImageByResourceId(IDR_APP_DEFAULT_ICON)); | 155 default_app_data_.reset(LoadImageByResourceId(IDR_APP_DEFAULT_ICON)); |
| 156 | 156 |
| 157 return default_app_data_.get(); | 157 return default_app_data_.get(); |
| 158 } | 158 } |
| 159 | 159 |
| 160 const SkBitmap* ExtensionIconSource::GetDefaultExtensionImage() { | 160 const SkBitmap* ExtensionIconSource::GetDefaultExtensionImage() { |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 std::map<int, ExtensionIconRequest*>::iterator i = | 343 std::map<int, ExtensionIconRequest*>::iterator i = |
| 344 request_map_.find(request_id); | 344 request_map_.find(request_id); |
| 345 if (i == request_map_.end()) | 345 if (i == request_map_.end()) |
| 346 return; | 346 return; |
| 347 | 347 |
| 348 delete i->second; | 348 delete i->second; |
| 349 request_map_.erase(i); | 349 request_map_.erase(i); |
| 350 } | 350 } |
| 351 | 351 |
| 352 } // namespace extensions | 352 } // namespace extensions |
| OLD | NEW |