OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 CHROME_BROWSER_EXTENSIONS_IMAGE_LOADER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_IMAGE_LOADER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_IMAGE_LOADER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_IMAGE_LOADER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 namespace extensions { | 26 namespace extensions { |
27 | 27 |
28 class Extension; | 28 class Extension; |
29 | 29 |
30 // This class is responsible for asynchronously loading extension images and | 30 // This class is responsible for asynchronously loading extension images and |
31 // calling a callback when an image is loaded. | 31 // calling a callback when an image is loaded. |
32 // The views need to load their icons asynchronously might be deleted before | 32 // The views need to load their icons asynchronously might be deleted before |
33 // the images have loaded. If you pass your callback using a weak_ptr, this | 33 // the images have loaded. If you pass your callback using a weak_ptr, this |
34 // will make sure the callback won't be called after the view is deleted. | 34 // will make sure the callback won't be called after the view is deleted. |
35 class ImageLoader : public ProfileKeyedService { | 35 class ImageLoader : public BrowserContextKeyedService { |
36 public: | 36 public: |
37 // Information about a singe image representation to load from an extension | 37 // Information about a singe image representation to load from an extension |
38 // resource. | 38 // resource. |
39 struct ImageRepresentation { | 39 struct ImageRepresentation { |
40 // Enum values to indicate whether to resize loaded bitmap when it is larger | 40 // Enum values to indicate whether to resize loaded bitmap when it is larger |
41 // than |desired_size| or always resize it. | 41 // than |desired_size| or always resize it. |
42 enum ResizeCondition { | 42 enum ResizeCondition { |
43 RESIZE_WHEN_LARGER, | 43 RESIZE_WHEN_LARGER, |
44 ALWAYS_RESIZE, | 44 ALWAYS_RESIZE, |
45 }; | 45 }; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 std::vector<LoadResult>* load_result); | 108 std::vector<LoadResult>* load_result); |
109 | 109 |
110 void ReplyBack( | 110 void ReplyBack( |
111 const std::vector<LoadResult>* load_result, | 111 const std::vector<LoadResult>* load_result, |
112 const base::Callback<void(const gfx::Image&)>& callback); | 112 const base::Callback<void(const gfx::Image&)>& callback); |
113 }; | 113 }; |
114 | 114 |
115 } // namespace extensions | 115 } // namespace extensions |
116 | 116 |
117 #endif // CHROME_BROWSER_EXTENSIONS_IMAGE_LOADER_H_ | 117 #endif // CHROME_BROWSER_EXTENSIONS_IMAGE_LOADER_H_ |
OLD | NEW |