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 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
14 #include "content/public/browser/notification_observer.h" | 14 #include "content/public/browser/notification_observer.h" |
15 #include "content/public/browser/notification_registrar.h" | 15 #include "content/public/browser/notification_registrar.h" |
16 #include "extensions/common/extension_icon_set.h" | 16 #include "extensions/common/extension_icon_set.h" |
17 #include "ui/base/layout.h" | 17 #include "ui/base/layout.h" |
18 #include "ui/gfx/image/image.h" | 18 #include "ui/gfx/image/image.h" |
19 #include "ui/gfx/image/image_skia.h" | 19 #include "ui/gfx/image/image_skia.h" |
20 | 20 |
21 namespace content { | 21 namespace content { |
22 class BrowserContext; | 22 class BrowserContext; |
23 } | 23 } |
24 | 24 |
25 namespace extensions { | 25 namespace extensions { |
26 class Extension; | 26 class Extension; |
27 } | 27 } |
28 | 28 |
29 namespace gfx { | 29 namespace gfx { |
30 class Size; | |
31 class Image; | 30 class Image; |
32 } | 31 } |
33 | 32 |
34 namespace extensions { | 33 namespace extensions { |
35 | 34 |
36 // A class that provides an ImageSkia for UI code to use. It handles extension | 35 // A class that provides an ImageSkia for UI code to use. It handles extension |
37 // icon resource loading, screen scale factor change etc. UI code that uses | 36 // icon resource loading, screen scale factor change etc. UI code that uses |
38 // extension icon should host this class. In painting code, UI code paints with | 37 // extension icon should host this class. In painting code, UI code paints with |
39 // the ImageSkia provided by this class. If the required extension icon resource | 38 // the ImageSkia provided by this class. If the required extension icon resource |
40 // is not already present, this class tries to load it and calls its observer | 39 // is not already present, this class tries to load it and calls its observer |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 content::NotificationRegistrar registrar_; | 119 content::NotificationRegistrar registrar_; |
121 | 120 |
122 base::WeakPtrFactory<IconImage> weak_ptr_factory_; | 121 base::WeakPtrFactory<IconImage> weak_ptr_factory_; |
123 | 122 |
124 DISALLOW_COPY_AND_ASSIGN(IconImage); | 123 DISALLOW_COPY_AND_ASSIGN(IconImage); |
125 }; | 124 }; |
126 | 125 |
127 } // namespace extensions | 126 } // namespace extensions |
128 | 127 |
129 #endif // EXTENSIONS_BROWSER_EXTENSION_ICON_IMAGE_H_ | 128 #endif // EXTENSIONS_BROWSER_EXTENSION_ICON_IMAGE_H_ |
OLD | NEW |