summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-13 05:01:38 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-13 05:01:38 +0000
commit8ef584b29c2246a3c3a995c79bd67af40fbcfbf6 (patch)
tree8e87edd30ab251c3e0525b248216d30d364acf9b /chrome
parent0e55c84770b95a2f2c80fc9edaaf81bbf4e691ad (diff)
downloadchromium_src-8ef584b29c2246a3c3a995c79bd67af40fbcfbf6.zip
chromium_src-8ef584b29c2246a3c3a995c79bd67af40fbcfbf6.tar.gz
chromium_src-8ef584b29c2246a3c3a995c79bd67af40fbcfbf6.tar.bz2
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
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/resources/ntp4/new_tab.css19
-rw-r--r--chrome/browser/resources/ntp4/new_tab.html3
-rw-r--r--chrome/browser/ui/webui/ntp/ntp_resource_cache.cc6
3 files changed, 23 insertions, 5 deletions
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 @@
<html i18n-values="
dir:textdirection;
hasattribution:hasattribution;
- customlogo:customlogo;">
+ customlogo:customlogo;
+ themegravity:themegravity;">
<head>
<meta charset="utf-8">
<title i18n-content="title"></title>
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());