diff options
author | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-02 20:53:50 +0000 |
---|---|---|
committer | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-02 20:53:50 +0000 |
commit | 7895ea23e75075fd6f9fe5a6c3dfb17d3456b208 (patch) | |
tree | d9f36ade5222fbdab94c0b40f66b456f9eba308e /chrome/common/extensions | |
parent | 77be37906a16c98612360a2e35c257aa5484cf2d (diff) | |
download | chromium_src-7895ea23e75075fd6f9fe5a6c3dfb17d3456b208.zip chromium_src-7895ea23e75075fd6f9fe5a6c3dfb17d3456b208.tar.gz chromium_src-7895ea23e75075fd6f9fe5a6c3dfb17d3456b208.tar.bz2 |
Allow themes to change the background of the new tab page. Adds support for display properties to themes (stored internally as ints/enums, but parsed from text).
BUG=12768
TEST=Install a theme with an new tab page background and verify that the background appears on the new tab page.
Review URL: http://codereview.chromium.org/115910
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17431 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions')
-rw-r--r-- | chrome/common/extensions/extension.cc | 8 | ||||
-rw-r--r-- | chrome/common/extensions/extension.h | 7 |
2 files changed, 15 insertions, 0 deletions
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc index cdf484b..4c2914e 100644 --- a/chrome/common/extensions/extension.cc +++ b/chrome/common/extensions/extension.cc @@ -34,6 +34,7 @@ const wchar_t* Extension::kThemeKey = L"theme"; const wchar_t* Extension::kThemeImagesKey = L"images"; const wchar_t* Extension::kThemeColorsKey = L"colors"; const wchar_t* Extension::kThemeTintsKey = L"tints"; +const wchar_t* Extension::kThemeDisplayPropertiesKey = L"properties"; const wchar_t* Extension::kToolstripsKey = L"toolstrips"; const wchar_t* Extension::kTooltipKey = L"tooltip"; const wchar_t* Extension::kTypeKey = L"type"; @@ -577,6 +578,13 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_id, static_cast<DictionaryValue*>(tints_value->DeepCopy())); } + DictionaryValue* display_properties_value; + if (theme_value->GetDictionary(kThemeDisplayPropertiesKey, + &display_properties_value)) { + theme_display_properties_.reset( + static_cast<DictionaryValue*>(display_properties_value->DeepCopy())); + } + return true; } diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h index 1256b17f..782b823 100644 --- a/chrome/common/extensions/extension.h +++ b/chrome/common/extensions/extension.h @@ -51,6 +51,7 @@ class Extension { static const wchar_t* kThemeImagesKey; static const wchar_t* kThemeColorsKey; static const wchar_t* kThemeTintsKey; + static const wchar_t* kThemeDisplayPropertiesKey; static const wchar_t* kToolstripsKey; static const wchar_t* kTooltipKey; static const wchar_t* kTypeKey; @@ -161,6 +162,9 @@ class Extension { DictionaryValue* GetThemeImages() const { return theme_images_.get(); } DictionaryValue* GetThemeColors() const { return theme_colors_.get(); } DictionaryValue* GetThemeTints() const { return theme_tints_.get(); } + DictionaryValue* GetThemeDisplayProperties() const { + return theme_display_properties_.get(); + } bool IsTheme() { return is_theme_; } private: @@ -238,6 +242,9 @@ class Extension { // A map of color names to colors. scoped_ptr<DictionaryValue> theme_tints_; + // A map of display properties. + scoped_ptr<DictionaryValue> theme_display_properties_; + // Whether the extension is a theme - if it is, certain things are disabled. bool is_theme_; |