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

Side by Side Diff: chrome/common/extensions/extension.cc

Issue 1075006: Eliminate all UI thread decoding of extension images.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_resource.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/common/extensions/extension.h" 5 #include "chrome/common/extensions/extension.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
(...skipping 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after
1477 ExtensionResource Extension::GetIconPath(Icons icon) { 1477 ExtensionResource Extension::GetIconPath(Icons icon) {
1478 std::map<int, std::string>::const_iterator iter = icons_.find(icon); 1478 std::map<int, std::string>::const_iterator iter = icons_.find(icon);
1479 if (iter == icons_.end()) 1479 if (iter == icons_.end())
1480 return ExtensionResource(); 1480 return ExtensionResource();
1481 return GetResource(iter->second); 1481 return GetResource(iter->second);
1482 } 1482 }
1483 1483
1484 Extension::Icons Extension::GetIconPathAllowLargerSize( 1484 Extension::Icons Extension::GetIconPathAllowLargerSize(
1485 ExtensionResource* resource, Icons icon) { 1485 ExtensionResource* resource, Icons icon) {
1486 *resource = GetIconPath(icon); 1486 *resource = GetIconPath(icon);
1487 if (!resource->GetFilePath().empty()) 1487 if (!resource->relative_path().empty())
1488 return icon; 1488 return icon;
1489 if (icon == EXTENSION_ICON_BITTY) 1489 if (icon == EXTENSION_ICON_BITTY)
1490 return GetIconPathAllowLargerSize(resource, EXTENSION_ICON_SMALL); 1490 return GetIconPathAllowLargerSize(resource, EXTENSION_ICON_SMALL);
1491 if (icon == EXTENSION_ICON_SMALL) 1491 if (icon == EXTENSION_ICON_SMALL)
1492 return GetIconPathAllowLargerSize(resource, EXTENSION_ICON_MEDIUM); 1492 return GetIconPathAllowLargerSize(resource, EXTENSION_ICON_MEDIUM);
1493 if (icon == EXTENSION_ICON_MEDIUM) 1493 if (icon == EXTENSION_ICON_MEDIUM)
1494 return GetIconPathAllowLargerSize(resource, EXTENSION_ICON_LARGE); 1494 return GetIconPathAllowLargerSize(resource, EXTENSION_ICON_LARGE);
1495 return EXTENSION_ICON_LARGE; 1495 return EXTENSION_ICON_LARGE;
1496 } 1496 }
1497 1497
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
1571 } else { 1571 } else {
1572 return false; 1572 return false;
1573 } 1573 }
1574 } else { 1574 } else {
1575 return true; 1575 return true;
1576 } 1576 }
1577 } 1577 }
1578 } 1578 }
1579 return false; 1579 return false;
1580 } 1580 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698