diff options
author | mirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-18 03:23:33 +0000 |
---|---|---|
committer | mirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-18 03:23:33 +0000 |
commit | 1df50c8de4ca23b55ac99e26497fe8ba5864b6f3 (patch) | |
tree | 572ce80a9d0d7270222b45ebd2ab801a90fc428d /chrome/browser/browser_theme_provider.h | |
parent | c8ced031ff61f75ebe05b3ac4d2a27ab8936fc18 (diff) | |
download | chromium_src-1df50c8de4ca23b55ac99e26497fe8ba5864b6f3.zip chromium_src-1df50c8de4ca23b55ac99e26497fe8ba5864b6f3.tar.gz chromium_src-1df50c8de4ca23b55ac99e26497fe8ba5864b6f3.tar.bz2 |
Allow the tiling of theme background images on the NTP.
BUG= http://crbug/com/15796
TEST= Add a property for tiling to a theme manifest.json. Observe that the theme image is tiled on the NTP.
Review URL: http://codereview.chromium.org/149741
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21039 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_theme_provider.h')
-rw-r--r-- | chrome/browser/browser_theme_provider.h | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/chrome/browser/browser_theme_provider.h b/chrome/browser/browser_theme_provider.h index 6d7bb70..4787c000 100644 --- a/chrome/browser/browser_theme_provider.h +++ b/chrome/browser/browser_theme_provider.h @@ -56,6 +56,7 @@ class BrowserThemeProvider : public base::RefCounted<BrowserThemeProvider>, // Strings used by themes to identify miscellaneous numerical properties. static const char* kDisplayPropertyNTPAlignment; + static const char* kDisplayPropertyNTPTiling; // Strings used in alignment properties. static const char* kAlignmentTop; @@ -63,6 +64,12 @@ class BrowserThemeProvider : public base::RefCounted<BrowserThemeProvider>, static const char* kAlignmentLeft; static const char* kAlignmentRight; + // Strings used in tiling properties. + static const char* kTilingNoRepeat; + static const char* kTilingRepeatX; + static const char* kTilingRepeatY; + static const char* kTilingRepeat; + // Default colors. static const SkColor kDefaultColorFrame; static const SkColor kDefaultColorFrameInactive; @@ -115,7 +122,8 @@ class BrowserThemeProvider : public base::RefCounted<BrowserThemeProvider>, TINT_FRAME_INCOGNITO, TINT_FRAME_INCOGNITO_INACTIVE, TINT_BACKGROUND_TAB, - NTP_BACKGROUND_ALIGNMENT + NTP_BACKGROUND_ALIGNMENT, + NTP_BACKGROUND_TILING }; // A bitfield mask for alignments. @@ -127,7 +135,15 @@ class BrowserThemeProvider : public base::RefCounted<BrowserThemeProvider>, ALIGN_BOTTOM = 0x8, } AlignmentMasks; - virtual void Init(Profile* profile); + // Background tiling choices. + enum { + NO_REPEAT = 0, + REPEAT_X = 1, + REPEAT_Y = 2, + REPEAT = 3 + } Tiling; + + void Init(Profile* profile); // ThemeProvider implementation. virtual SkBitmap* GetBitmapNamed(int id); @@ -161,6 +177,13 @@ class BrowserThemeProvider : public base::RefCounted<BrowserThemeProvider>, // AlignmentMasks static int StringToAlignment(const std::string &alignment); + // Convert a tiling value into a string like "no-repeat". Public + // so that it can be used to generate CSS values. Takes a Tiling. + static std::string TilingToString(int tiling); + + // Parse tiling values from something like "no-repeat" into a Tiling value. + static int StringToTiling(const std::string &tiling); + protected: // Sets an individual color value. void SetColor(const char* id, const SkColor& color); |