diff options
author | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-25 21:17:43 +0000 |
---|---|---|
committer | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-25 21:17:43 +0000 |
commit | c8559b7daaa7d9877fca1cf355baf62eb4c54668 (patch) | |
tree | c8551012cfbc0800aad09af6ed7cb08b67311935 /chrome | |
parent | ceae8579ac4d3329eec766525f976f6383678c76 (diff) | |
download | chromium_src-c8559b7daaa7d9877fca1cf355baf62eb4c54668.zip chromium_src-c8559b7daaa7d9877fca1cf355baf62eb4c54668.tar.gz chromium_src-c8559b7daaa7d9877fca1cf355baf62eb4c54668.tar.bz2 |
- Fix bug where white logo wasn't showing
- Add attribution support back to the NTP
BUG=20019
TEST=Install a theme with a white logo and attribution, and verify that both display correctly.
Review URL: http://codereview.chromium.org/173372
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24323 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/browser_theme_provider.cc | 12 | ||||
-rw-r--r-- | chrome/browser/dom_ui/dom_ui_theme_source.cc | 3 | ||||
-rw-r--r-- | chrome/browser/resources/new_new_tab.html | 8 | ||||
-rw-r--r-- | chrome/browser/resources/new_new_tab.js | 5 | ||||
-rw-r--r-- | chrome/browser/resources/new_tab_theme.css | 5 |
5 files changed, 23 insertions, 10 deletions
diff --git a/chrome/browser/browser_theme_provider.cc b/chrome/browser/browser_theme_provider.cc index 6021712..0b43fa3 100644 --- a/chrome/browser/browser_theme_provider.cc +++ b/chrome/browser/browser_theme_provider.cc @@ -265,12 +265,6 @@ void BrowserThemeProvider::Init(Profile* profile) { SkBitmap* BrowserThemeProvider::GetBitmapNamed(int id) { DCHECK(CalledOnValidThread()); - // Check to see whether we should substitute some images. - int ntp_alternate; - GetDisplayProperty(NTP_LOGO_ALTERNATE, &ntp_alternate); - if (id == IDR_PRODUCT_LOGO && ntp_alternate != 0) - id = IDR_PRODUCT_LOGO_WHITE; - // Check to see if we already have the Skia image in the cache. ImageCache::const_iterator found = image_cache_.find(id); if (found != image_cache_.end()) @@ -459,6 +453,12 @@ bool BrowserThemeProvider::HasCustomImage(int id) { bool BrowserThemeProvider::GetRawData(int id, std::vector<unsigned char>* raw_data) { + // Check to see whether we should substitute some images. + int ntp_alternate; + GetDisplayProperty(NTP_LOGO_ALTERNATE, &ntp_alternate); + if (id == IDR_PRODUCT_LOGO && ntp_alternate != 0) + id = IDR_PRODUCT_LOGO_WHITE; + if (raw_data_.find(id) != raw_data_.end()) { *raw_data = raw_data_[id]; return true; diff --git a/chrome/browser/dom_ui/dom_ui_theme_source.cc b/chrome/browser/dom_ui/dom_ui_theme_source.cc index b7f5aab..59f3485 100644 --- a/chrome/browser/dom_ui/dom_ui_theme_source.cc +++ b/chrome/browser/dom_ui/dom_ui_theme_source.cc @@ -148,6 +148,9 @@ void DOMUIThemeSource::SendNewTabCSS(int request_id) { subst2.push_back(SkColorToRGBAString(color_section_border)); // $$2 subst2.push_back(SkColorToRGBAString(color_section_text)); // $$3 subst2.push_back(SkColorToRGBAString(color_section_link)); // $$4 + subst2.push_back( + UTF8ToUTF16(tp->HasCustomImage(IDR_THEME_NTP_ATTRIBUTION) ? + "block" : "none")); // $$5 // Get our template. static const StringPiece new_tab_theme_css( diff --git a/chrome/browser/resources/new_new_tab.html b/chrome/browser/resources/new_new_tab.html index 22997b3..9415d16 100644 --- a/chrome/browser/resources/new_new_tab.html +++ b/chrome/browser/resources/new_new_tab.html @@ -223,6 +223,11 @@ document.write('<link id="themecss" rel="stylesheet" ' + <span><a href=""> </a></span> </div> + <div id="attribution" class="attribution"> + <span i18n-content="attributionintro"></span><br /> + <img id="attribution-img" /> + </div> + </div> <!-- main --> <div> @@ -234,7 +239,8 @@ document.write('<link id="themecss" rel="stylesheet" ' + jscontent="title"></span> </div> </div> - +</body> <script src="local_strings.js"></script> <script src="new_new_tab.js"></script> +<script>updateAttribution();</script> </html> diff --git a/chrome/browser/resources/new_new_tab.js b/chrome/browser/resources/new_new_tab.js index 1bae2c7..78f7912 100644 --- a/chrome/browser/resources/new_new_tab.js +++ b/chrome/browser/resources/new_new_tab.js @@ -801,9 +801,8 @@ function themeChanged() { } function updateAttribution() { - // TODO(arv): Implement - //$('attribution-img').src = 'chrome://theme/theme_ntp_attribution?' + - // Date.now(); + $('attribution-img').src = 'chrome://theme/theme_ntp_attribution?' + + Date.now(); } function bookmarkBarAttached() { diff --git a/chrome/browser/resources/new_tab_theme.css b/chrome/browser/resources/new_tab_theme.css index b8459aa..3351e49 100644 --- a/chrome/browser/resources/new_tab_theme.css +++ b/chrome/browser/resources/new_tab_theme.css @@ -60,3 +60,8 @@ body { color: $$4; /* COLOR_NTP_SECTION_LINK */ text-decoration:underline; } + +#attribution { + display : $$5; + text-align:right; +} |