OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef EXTENSIONS_BROWSER_EXTENSION_ICON_IMAGE_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_ICON_IMAGE_H_ |
6 #define EXTENSIONS_BROWSER_EXTENSION_ICON_IMAGE_H_ | 6 #define EXTENSIONS_BROWSER_EXTENSION_ICON_IMAGE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // If representation loading is asynchronous, an empty image | 82 // If representation loading is asynchronous, an empty image |
83 // representation is returned. When the representation gets loaded the | 83 // representation is returned. When the representation gets loaded the |
84 // observer's |OnExtensionIconImageLoaded| will be called. | 84 // observer's |OnExtensionIconImageLoaded| will be called. |
85 gfx::ImageSkiaRep LoadImageForScaleFactor(ui::ScaleFactor scale_factor); | 85 gfx::ImageSkiaRep LoadImageForScaleFactor(ui::ScaleFactor scale_factor); |
86 | 86 |
87 void OnImageLoaded(float scale_factor, const gfx::Image& image); | 87 void OnImageLoaded(float scale_factor, const gfx::Image& image); |
88 | 88 |
89 // content::NotificationObserver overrides: | 89 // content::NotificationObserver overrides: |
90 virtual void Observe(int type, | 90 virtual void Observe(int type, |
91 const content::NotificationSource& source, | 91 const content::NotificationSource& source, |
92 const content::NotificationDetails& details) OVERRIDE; | 92 const content::NotificationDetails& details) override; |
93 | 93 |
94 content::BrowserContext* browser_context_; | 94 content::BrowserContext* browser_context_; |
95 const Extension* extension_; | 95 const Extension* extension_; |
96 const ExtensionIconSet& icon_set_; | 96 const ExtensionIconSet& icon_set_; |
97 const int resource_size_in_dip_; | 97 const int resource_size_in_dip_; |
98 | 98 |
99 Observer* observer_; | 99 Observer* observer_; |
100 | 100 |
101 Source* source_; // Owned by ImageSkia storage. | 101 Source* source_; // Owned by ImageSkia storage. |
102 gfx::ImageSkia image_skia_; | 102 gfx::ImageSkia image_skia_; |
103 // The icon with whose representation |image_skia_| should be updated if | 103 // The icon with whose representation |image_skia_| should be updated if |
104 // its own representation load fails. | 104 // its own representation load fails. |
105 gfx::ImageSkia default_icon_; | 105 gfx::ImageSkia default_icon_; |
106 | 106 |
107 content::NotificationRegistrar registrar_; | 107 content::NotificationRegistrar registrar_; |
108 | 108 |
109 base::WeakPtrFactory<IconImage> weak_ptr_factory_; | 109 base::WeakPtrFactory<IconImage> weak_ptr_factory_; |
110 | 110 |
111 DISALLOW_COPY_AND_ASSIGN(IconImage); | 111 DISALLOW_COPY_AND_ASSIGN(IconImage); |
112 }; | 112 }; |
113 | 113 |
114 } // namespace extensions | 114 } // namespace extensions |
115 | 115 |
116 #endif // EXTENSIONS_BROWSER_EXTENSION_ICON_IMAGE_H_ | 116 #endif // EXTENSIONS_BROWSER_EXTENSION_ICON_IMAGE_H_ |
OLD | NEW |