From 8ef584b29c2246a3c3a995c79bd67af40fbcfbf6 Mon Sep 17 00:00:00 2001 From: "estade@chromium.org" Date: Sat, 13 Aug 2011 05:01:38 +0000 Subject: ntp4: attribution tweak fix the attribution for RTL (put it on the left). Also, flip the attribution side for LTR if the theme is right-aligned. Most right-aligned images will conflict with the theme attribution if it's on the right (it was on the left in ntp3). This fixes the attribution for my personal favorite theme, Justin Bieber, and also Nik Daum, which is OK I guess. I didn't flip for left-aligned themes in RTL because almost all themes are left-aligned, and it's usually not conflicting. BUG=none TEST=install Nik Daum theme; attribution should be legible Review URL: http://codereview.chromium.org/7647001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96683 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/resources/ntp4/new_tab.css | 19 +++++++++++++++---- chrome/browser/resources/ntp4/new_tab.html | 3 ++- chrome/browser/ui/webui/ntp/ntp_resource_cache.cc | 6 ++++++ 3 files changed, 23 insertions(+), 5 deletions(-) (limited to 'chrome') diff --git a/chrome/browser/resources/ntp4/new_tab.css b/chrome/browser/resources/ntp4/new_tab.css index bf4114c..344af8d 100644 --- a/chrome/browser/resources/ntp4/new_tab.css +++ b/chrome/browser/resources/ntp4/new_tab.css @@ -108,17 +108,28 @@ body { #attribution { bottom: 0; - position: absolute; + left: auto; + margin-left: 8px; /* Leave room for the scrollbar. */ - right: 13px; + margin-right: 13px; + position: absolute; + right: 0; + text-align: left; z-index: -5; } +/* For themes that right-align their images, we flip the attribution to the + * left to avoid conflicts. */ +html[themegravity='right'] #attribution, +html[dir='rtl'] #attribution { + left: 0; + right: auto; + text-align: right; +} + #attribution > span { display: block; font-size: 84%; - /* Text should be left aligned regardless of diretionality. */ - text-align: left; } #footer { diff --git a/chrome/browser/resources/ntp4/new_tab.html b/chrome/browser/resources/ntp4/new_tab.html index 78ced3d..c769b4d 100644 --- a/chrome/browser/resources/ntp4/new_tab.html +++ b/chrome/browser/resources/ntp4/new_tab.html @@ -2,7 +2,8 @@ + customlogo:customlogo; + themegravity:themegravity;"> diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc index c126fc0..92c2562 100644 --- a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc +++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc @@ -384,6 +384,12 @@ void NTPResourceCache::CreateNewTabHTML() { ui::Animation::ShouldRenderRichAnimation() ? "true" : "false"; localized_strings.SetString("anim", anim); + int alignment; + ui::ThemeProvider* tp = ThemeServiceFactory::GetForProfile(profile_); + tp->GetDisplayProperty(ThemeService::NTP_BACKGROUND_ALIGNMENT, &alignment); + if (alignment & ThemeService::ALIGN_RIGHT) + localized_strings.SetString("themegravity", "right"); + // Pass the shown_sections pref early so that we can prevent flicker. const int shown_sections = ShownSectionsHandler::GetShownSections( profile_->GetPrefs()); -- cgit v1.1