OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |