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_THEMES_BROWSER_THEME_PACK_H_ | 5 #ifndef CHROME_BROWSER_THEMES_BROWSER_THEME_PACK_H_ |
6 #define CHROME_BROWSER_THEMES_BROWSER_THEME_PACK_H_ | 6 #define CHROME_BROWSER_THEMES_BROWSER_THEME_PACK_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 // Returns a unique id to use to store the raw bitmap for |prs_id| at | 211 // Returns a unique id to use to store the raw bitmap for |prs_id| at |
212 // |scale_factor| in memory. | 212 // |scale_factor| in memory. |
213 int GetRawIDByPersistentID(int prs_id, ui::ScaleFactor scale_factor) const; | 213 int GetRawIDByPersistentID(int prs_id, ui::ScaleFactor scale_factor) const; |
214 | 214 |
215 // Returns true if the |key| specifies a valid scale (e.g. "100") and | 215 // Returns true if the |key| specifies a valid scale (e.g. "100") and |
216 // the corresponding scale factor is currently in use. If true, returns | 216 // the corresponding scale factor is currently in use. If true, returns |
217 // the scale factor in |scale_factor|. | 217 // the scale factor in |scale_factor|. |
218 bool GetScaleFactorFromManifestKey(const std::string& key, | 218 bool GetScaleFactorFromManifestKey(const std::string& key, |
219 ui::ScaleFactor* scale_factor) const; | 219 ui::ScaleFactor* scale_factor) const; |
220 | 220 |
| 221 // Generates raw images for any missing scale from an available scale. |
| 222 void GenerateRawImageForAllSupportedScales(int prs_id); |
| 223 |
221 // Data pack, if we have one. | 224 // Data pack, if we have one. |
222 scoped_ptr<ui::DataPack> data_pack_; | 225 scoped_ptr<ui::DataPack> data_pack_; |
223 | 226 |
224 // All structs written to disk need to be packed; no alignment tricks here, | 227 // All structs written to disk need to be packed; no alignment tricks here, |
225 // please. | 228 // please. |
226 #pragma pack(push,1) | 229 #pragma pack(push,1) |
227 // Header that is written to disk. | 230 // Header that is written to disk. |
228 struct BrowserThemePackHeader { | 231 struct BrowserThemePackHeader { |
229 // Numeric version to make sure we're compatible in the future. | 232 // Numeric version to make sure we're compatible in the future. |
230 int32 version; | 233 int32 version; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 // Cache of images created in BuildFromExtension(). Once the theme pack is | 281 // Cache of images created in BuildFromExtension(). Once the theme pack is |
279 // created, this cache should only be accessed on the file thread. There | 282 // created, this cache should only be accessed on the file thread. There |
280 // should be no IDs in |image_memory_| that are in |images_on_file_thread_| | 283 // should be no IDs in |image_memory_| that are in |images_on_file_thread_| |
281 // or vice versa. | 284 // or vice versa. |
282 ImageCache images_on_file_thread_; | 285 ImageCache images_on_file_thread_; |
283 | 286 |
284 DISALLOW_COPY_AND_ASSIGN(BrowserThemePack); | 287 DISALLOW_COPY_AND_ASSIGN(BrowserThemePack); |
285 }; | 288 }; |
286 | 289 |
287 #endif // CHROME_BROWSER_THEMES_BROWSER_THEME_PACK_H_ | 290 #endif // CHROME_BROWSER_THEMES_BROWSER_THEME_PACK_H_ |
OLD | NEW |