summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_theme_pack.h
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-03 20:28:18 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-03 20:28:18 +0000
commit64909e688bc9ad982acc764f69b7e27e89caba7f (patch)
tree9ce867596e528905c24f76f2989a90f5d6dadd51 /chrome/browser/browser_theme_pack.h
parent25d47c7bbed2e0dd27aeceb815505fe450dcd6ad (diff)
downloadchromium_src-64909e688bc9ad982acc764f69b7e27e89caba7f.zip
chromium_src-64909e688bc9ad982acc764f69b7e27e89caba7f.tar.gz
chromium_src-64909e688bc9ad982acc764f69b7e27e89caba7f.tar.bz2
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
Diffstat (limited to 'chrome/browser/browser_theme_pack.h')
-rw-r--r--chrome/browser/browser_theme_pack.h14
1 files changed, 12 insertions, 2 deletions
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<BrowserThemePack> {
// The type passed to base::DataPack::WritePack.
typedef std::map<uint32, base::StringPiece> RawDataForWriting;
+ // An association between an id and the FilePath that has the image data.
+ typedef std::map<int, FilePath> FilePathMap;
+
// Default. Everything is empty.
BrowserThemePack();
@@ -110,10 +113,13 @@ class BrowserThemePack : public base::RefCountedThreadSafe<BrowserThemePack> {
// Parses the image names out of an extension.
void ParseImageNamesFromJSON(DictionaryValue* images_value,
FilePath images_path,
- std::map<int, FilePath>* 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<int, FilePath>& 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<BrowserThemePack> {
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