summaryrefslogtreecommitdiffstats
path: root/chrome/browser/themes
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-27 21:39:03 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-27 21:39:03 +0000
commite15283df626c56c57b1588f3ece9c7d5a7fdae12 (patch)
treecb34db4be24cc795812acce0c6c135aaf77d2b3f /chrome/browser/themes
parentfc3df9349b1af8cdebfdd79f281cb743c66ee593 (diff)
downloadchromium_src-e15283df626c56c57b1588f3ece9c7d5a7fdae12.zip
chromium_src-e15283df626c56c57b1588f3ece9c7d5a7fdae12.tar.gz
chromium_src-e15283df626c56c57b1588f3ece9c7d5a7fdae12.tar.bz2
ntp theme fixes
1. fix where the theme background is displayed for default (0) alignment -- it should be center center. This matches what the bookmark bar does. This may break some themes that rely on the default being top-left alignment. I can't see a way around this. 2. Fix the bookmark bar for vertical center alignment. 3. update the ntp background when the bookmark bar is attached/detached. TODO: transition (3) so that it looks good on windows and mac. BUG=115594 TEST=manual Review URL: https://chromiumcodereview.appspot.com/9467027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123804 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/themes')
-rw-r--r--chrome/browser/themes/theme_service.cc11
-rw-r--r--chrome/browser/themes/theme_service.h1
2 files changed, 5 insertions, 7 deletions
diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc
index e0f8f15..910d176 100644
--- a/chrome/browser/themes/theme_service.cc
+++ b/chrome/browser/themes/theme_service.cc
@@ -29,6 +29,7 @@ using content::BrowserThread;
using content::UserMetricsAction;
// Strings used in alignment properties.
+const char* ThemeService::kAlignmentCenter = "center";
const char* ThemeService::kAlignmentTop = "top";
const char* ThemeService::kAlignmentBottom = "bottom";
const char* ThemeService::kAlignmentLeft = "left";
@@ -377,8 +378,8 @@ std::string ThemeService::GetThemeID() const {
// static
std::string ThemeService::AlignmentToString(int alignment) {
// Convert from an AlignmentProperty back into a string.
- std::string vertical_string;
- std::string horizontal_string;
+ std::string vertical_string(kAlignmentCenter);
+ std::string horizontal_string(kAlignmentCenter);
if (alignment & ThemeService::ALIGN_TOP)
vertical_string = kAlignmentTop;
@@ -390,11 +391,7 @@ std::string ThemeService::AlignmentToString(int alignment) {
else if (alignment & ThemeService::ALIGN_RIGHT)
horizontal_string = kAlignmentRight;
- if (vertical_string.empty())
- return horizontal_string;
- if (horizontal_string.empty())
- return vertical_string;
- return vertical_string + " " + horizontal_string;
+ return horizontal_string + " " + vertical_string;
}
// static
diff --git a/chrome/browser/themes/theme_service.h b/chrome/browser/themes/theme_service.h
index 4ecde66..12964cf 100644
--- a/chrome/browser/themes/theme_service.h
+++ b/chrome/browser/themes/theme_service.h
@@ -52,6 +52,7 @@ class ThemeService : public base::NonThreadSafe,
// Public constants used in ThemeService and its subclasses:
// Strings used in alignment properties.
+ static const char* kAlignmentCenter;
static const char* kAlignmentTop;
static const char* kAlignmentBottom;
static const char* kAlignmentLeft;