diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-27 22:01:09 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-27 22:01:09 +0000 |
commit | e09cc594ec748ec3bd3275980cb422eef81d52e2 (patch) | |
tree | f5d365294133f632dd28daf74ee51c24d3856568 /chrome/browser/themes/theme_service.cc | |
parent | e468816fe2fdde97f56be94b2e06dcc33fbe259e (diff) | |
download | chromium_src-e09cc594ec748ec3bd3275980cb422eef81d52e2.zip chromium_src-e09cc594ec748ec3bd3275980cb422eef81d52e2.tar.gz chromium_src-e09cc594ec748ec3bd3275980cb422eef81d52e2.tar.bz2 |
Revert 123804 - 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
TBR=estade@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9475026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123811 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/themes/theme_service.cc')
-rw-r--r-- | chrome/browser/themes/theme_service.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc index 910d176..e0f8f15 100644 --- a/chrome/browser/themes/theme_service.cc +++ b/chrome/browser/themes/theme_service.cc @@ -29,7 +29,6 @@ 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"; @@ -378,8 +377,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(kAlignmentCenter); - std::string horizontal_string(kAlignmentCenter); + std::string vertical_string; + std::string horizontal_string; if (alignment & ThemeService::ALIGN_TOP) vertical_string = kAlignmentTop; @@ -391,7 +390,11 @@ std::string ThemeService::AlignmentToString(int alignment) { else if (alignment & ThemeService::ALIGN_RIGHT) horizontal_string = kAlignmentRight; - return horizontal_string + " " + vertical_string; + if (vertical_string.empty()) + return horizontal_string; + if (horizontal_string.empty()) + return vertical_string; + return vertical_string + " " + horizontal_string; } // static |