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/image_loading_tracker.h" | 5 #include "chrome/browser/extensions/image_loading_tracker.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 | 318 |
319 bool ImageLoadingTracker::IsComponentExtensionResource( | 319 bool ImageLoadingTracker::IsComponentExtensionResource( |
320 const Extension* extension, | 320 const Extension* extension, |
321 const FilePath& resource_path, | 321 const FilePath& resource_path, |
322 int* resource_id) { | 322 int* resource_id) { |
323 static const GritResourceMap kExtraComponentExtensionResources[] = { | 323 static const GritResourceMap kExtraComponentExtensionResources[] = { |
324 {"web_store/webstore_icon_128.png", IDR_WEBSTORE_ICON}, | 324 {"web_store/webstore_icon_128.png", IDR_WEBSTORE_ICON}, |
325 {"web_store/webstore_icon_16.png", IDR_WEBSTORE_ICON_16}, | 325 {"web_store/webstore_icon_16.png", IDR_WEBSTORE_ICON_16}, |
326 {"chrome_app/product_logo_128.png", IDR_PRODUCT_LOGO_128}, | 326 {"chrome_app/product_logo_128.png", IDR_PRODUCT_LOGO_128}, |
327 {"chrome_app/product_logo_16.png", IDR_PRODUCT_LOGO_16}, | 327 {"chrome_app/product_logo_16.png", IDR_PRODUCT_LOGO_16}, |
| 328 {"settings_app/settings_app_icon_128.png", IDR_SETTINGS_APP_ICON_128}, |
| 329 {"settings_app/settings_app_icon_16.png", IDR_SETTINGS_APP_ICON_16}, |
328 }; | 330 }; |
329 static const size_t kExtraComponentExtensionResourcesSize = | 331 static const size_t kExtraComponentExtensionResourcesSize = |
330 arraysize(kExtraComponentExtensionResources); | 332 arraysize(kExtraComponentExtensionResources); |
331 | 333 |
332 if (extension->location() != Extension::COMPONENT) | 334 if (extension->location() != Extension::COMPONENT) |
333 return false; | 335 return false; |
334 | 336 |
335 FilePath directory_path = extension->path(); | 337 FilePath directory_path = extension->path(); |
336 FilePath resources_dir; | 338 FilePath resources_dir; |
337 FilePath relative_path; | 339 FilePath relative_path; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 // Remove reference to this extension from all pending load entries. This | 426 // Remove reference to this extension from all pending load entries. This |
425 // ensures we don't attempt to cache the bitmap when the load completes. | 427 // ensures we don't attempt to cache the bitmap when the load completes. |
426 for (LoadMap::iterator i = load_map_.begin(); i != load_map_.end(); ++i) { | 428 for (LoadMap::iterator i = load_map_.begin(); i != load_map_.end(); ++i) { |
427 PendingLoadInfo* info = &i->second; | 429 PendingLoadInfo* info = &i->second; |
428 if (info->extension == extension) { | 430 if (info->extension == extension) { |
429 info->extension = NULL; | 431 info->extension = NULL; |
430 info->cache = DONT_CACHE; | 432 info->cache = DONT_CACHE; |
431 } | 433 } |
432 } | 434 } |
433 } | 435 } |
OLD | NEW |