From 64909e688bc9ad982acc764f69b7e27e89caba7f Mon Sep 17 00:00:00 2001 From: "erg@google.com" Date: Wed, 3 Feb 2010 20:28:18 +0000 Subject: Themes: HasCustomImage() must only return true for images that were provided by the extension and not for images that were autogenerated. Since this adds data to the theme pack file, bump the version number. BUG=34078 TEST=BrowserThemePackTest.TestHasCustomImage Review URL: http://codereview.chromium.org/562025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38006 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/browser_theme_pack.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'chrome/browser/browser_theme_pack.h') diff --git a/chrome/browser/browser_theme_pack.h b/chrome/browser/browser_theme_pack.h index 8e4bff1..656dc77 100644 --- a/chrome/browser/browser_theme_pack.h +++ b/chrome/browser/browser_theme_pack.h @@ -85,6 +85,9 @@ class BrowserThemePack : public base::RefCountedThreadSafe { // The type passed to base::DataPack::WritePack. typedef std::map RawDataForWriting; + // An association between an id and the FilePath that has the image data. + typedef std::map FilePathMap; + // Default. Everything is empty. BrowserThemePack(); @@ -110,10 +113,13 @@ class BrowserThemePack : public base::RefCountedThreadSafe { // Parses the image names out of an extension. void ParseImageNamesFromJSON(DictionaryValue* images_value, FilePath images_path, - std::map* file_paths) const; + FilePathMap* file_paths) const; + + // Creates the data for |source_images_| from |file_paths|. + void BuildSourceImagesArray(const FilePathMap& file_paths); // Loads the unmodified bitmaps packed in the extension to SkBitmaps. - void LoadRawBitmapsTo(const std::map& file_paths, + void LoadRawBitmapsTo(const FilePathMap& file_paths, ImageCache* raw_bitmaps); // Creates tinted and composited frame images. Source and destination is @@ -184,6 +190,10 @@ class BrowserThemePack : public base::RefCountedThreadSafe { int32 id; int32 property; } *display_properties_; + + // A list of included source images. A pointer to a -1 terminated array of + // our persistent IDs. + int* source_images_; #pragma pack(pop) // References to raw PNG data. This map isn't touched when |data_pack_| is -- cgit v1.1