diff options
Diffstat (limited to 'chrome/common/extensions/extension.cc')
-rw-r--r-- | chrome/common/extensions/extension.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc index a15669d..b12c764 100644 --- a/chrome/common/extensions/extension.cc +++ b/chrome/common/extensions/extension.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -1380,6 +1380,20 @@ ExtensionResource Extension::GetIconPath(Icons icon) { return GetResource(iter->second); } +Extension::Icons Extension::GetIconPathAllowLargerSize( + ExtensionResource* resource, Icons icon) { + *resource = GetIconPath(icon); + if (!resource->GetFilePath().empty()) + return icon; + if (icon == EXTENSION_ICON_BITTY) + return GetIconPathAllowLargerSize(resource, EXTENSION_ICON_SMALL); + if (icon == EXTENSION_ICON_SMALL) + return GetIconPathAllowLargerSize(resource, EXTENSION_ICON_MEDIUM); + if (icon == EXTENSION_ICON_MEDIUM) + return GetIconPathAllowLargerSize(resource, EXTENSION_ICON_LARGE); + return EXTENSION_ICON_LARGE; +} + bool Extension::CanExecuteScriptOnHost(const GURL& url, std::string* error) const { // No extensions are allowed to execute script on the gallery because that |