| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 // Default. Everything is empty. | 118 // Default. Everything is empty. |
| 119 BrowserThemePack(); | 119 BrowserThemePack(); |
| 120 | 120 |
| 121 virtual ~BrowserThemePack(); | 121 virtual ~BrowserThemePack(); |
| 122 | 122 |
| 123 // Builds a header ready to write to disk. | 123 // Builds a header ready to write to disk. |
| 124 void BuildHeader(const extensions::Extension* extension); | 124 void BuildHeader(const extensions::Extension* extension); |
| 125 | 125 |
| 126 // Transforms the JSON tint values into their final versions in the |tints_| | 126 // Transforms the JSON tint values into their final versions in the |tints_| |
| 127 // array. | 127 // array. |
| 128 void BuildTintsFromJSON(base::DictionaryValue* tints_value); | 128 void BuildTintsFromJSON(const base::DictionaryValue* tints_value); |
| 129 | 129 |
| 130 // Transforms the JSON color values into their final versions in the | 130 // Transforms the JSON color values into their final versions in the |
| 131 // |colors_| array and also fills in unspecified colors based on tint values. | 131 // |colors_| array and also fills in unspecified colors based on tint values. |
| 132 void BuildColorsFromJSON(base::DictionaryValue* color_value); | 132 void BuildColorsFromJSON(const base::DictionaryValue* color_value); |
| 133 | 133 |
| 134 // Implementation details of BuildColorsFromJSON(). | 134 // Implementation details of BuildColorsFromJSON(). |
| 135 void ReadColorsFromJSON(base::DictionaryValue* colors_value, | 135 void ReadColorsFromJSON(const base::DictionaryValue* colors_value, |
| 136 std::map<int, SkColor>* temp_colors); | 136 std::map<int, SkColor>* temp_colors); |
| 137 void GenerateMissingColors(std::map<int, SkColor>* temp_colors); | 137 void GenerateMissingColors(std::map<int, SkColor>* temp_colors); |
| 138 | 138 |
| 139 // Transforms the JSON display properties into |display_properties_|. | 139 // Transforms the JSON display properties into |display_properties_|. |
| 140 void BuildDisplayPropertiesFromJSON(base::DictionaryValue* display_value); | 140 void BuildDisplayPropertiesFromJSON( |
| 141 const base::DictionaryValue* display_value); |
| 141 | 142 |
| 142 // Parses the image names out of an extension. | 143 // Parses the image names out of an extension. |
| 143 void ParseImageNamesFromJSON(base::DictionaryValue* images_value, | 144 void ParseImageNamesFromJSON(const base::DictionaryValue* images_value, |
| 144 const base::FilePath& images_path, | 145 const base::FilePath& images_path, |
| 145 FilePathMap* file_paths) const; | 146 FilePathMap* file_paths) const; |
| 146 | 147 |
| 147 // Creates the data for |source_images_| from |file_paths|. | 148 // Creates the data for |source_images_| from |file_paths|. |
| 148 void BuildSourceImagesArray(const FilePathMap& file_paths); | 149 void BuildSourceImagesArray(const FilePathMap& file_paths); |
| 149 | 150 |
| 150 // Loads the unmodified images packed in the extension to SkBitmaps. Returns | 151 // Loads the unmodified images packed in the extension to SkBitmaps. Returns |
| 151 // true if all images loaded. | 152 // true if all images loaded. |
| 152 bool LoadRawBitmapsTo(const FilePathMap& file_paths, | 153 bool LoadRawBitmapsTo(const FilePathMap& file_paths, |
| 153 ImageCache* image_cache); | 154 ImageCache* image_cache); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 // Cache of images created in BuildFromExtension(). Once the theme pack is | 263 // Cache of images created in BuildFromExtension(). Once the theme pack is |
| 263 // created, this cache should only be accessed on the file thread. There | 264 // created, this cache should only be accessed on the file thread. There |
| 264 // should be no IDs in |image_memory_| that are in |images_on_file_thread_| | 265 // should be no IDs in |image_memory_| that are in |images_on_file_thread_| |
| 265 // or vice versa. | 266 // or vice versa. |
| 266 ImageCache images_on_file_thread_; | 267 ImageCache images_on_file_thread_; |
| 267 | 268 |
| 268 DISALLOW_COPY_AND_ASSIGN(BrowserThemePack); | 269 DISALLOW_COPY_AND_ASSIGN(BrowserThemePack); |
| 269 }; | 270 }; |
| 270 | 271 |
| 271 #endif // CHROME_BROWSER_THEMES_BROWSER_THEME_PACK_H_ | 272 #endif // CHROME_BROWSER_THEMES_BROWSER_THEME_PACK_H_ |
| OLD | NEW |