OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_ICON_FACTORY_DELEGATE_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_ICON_FACTORY_DELEGATE_H_ |
| 7 |
| 8 #include "chrome/common/extensions/extension_icon_set.h" |
| 9 |
| 10 namespace gfx { |
| 11 class ImageSkia; |
| 12 class Size; |
| 13 } |
| 14 |
| 15 // Used by code living in chrome/common/ to delegate icon creation when the icon |
| 16 // creation cannot be done from chrome/common/ (e.g. if the icon is loaded |
| 17 // asynchronously using ImageLoadingTracker). |
| 18 class ExtensionIconFactoryDelegate { |
| 19 public: |
| 20 virtual ~ExtensionIconFactoryDelegate() {} |
| 21 |
| 22 // Creates an icon of |desired_size| in device independent pixels, whose |
| 23 // image representations are selected from the set of bitmaps whose paths are |
| 24 // in |icon_set|. |
| 25 // The icon will be created asyncronously, so |ExtensionIconFactoryDelegate| |
| 26 // implementation will have to be observable for the created icon changes by |
| 27 // the code that uses the icon. |
| 28 virtual gfx::ImageSkia GetIcon(const ExtensionIconSet* icon_set, |
| 29 const gfx::Size& desired_size) = 0; |
| 30 }; |
| 31 |
| 32 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_ICON_FACTORY_DELEGATE_H_ |
OLD | NEW |