Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Side by Side Diff: chrome/browser/ui/webui/ntp/ntp_resource_cache.cc

Issue 9477018: retry r123804 - ntp theme fixes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/ntp/ntp_resource_cache.h" 5 #include "chrome/browser/ui/webui/ntp/ntp_resource_cache.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 #elif defined(OS_MACOSX) 134 #elif defined(OS_MACOSX)
135 int offset = bookmarks::kNTPBookmarkBarHeight; 135 int offset = bookmarks::kNTPBookmarkBarHeight;
136 #elif defined(TOOLKIT_GTK) 136 #elif defined(TOOLKIT_GTK)
137 int offset = BookmarkBarGtk::kBookmarkBarNTPHeight; 137 int offset = BookmarkBarGtk::kBookmarkBarNTPHeight;
138 #else 138 #else
139 int offset = 0; 139 int offset = 0;
140 #endif 140 #endif
141 141
142 if (alignment & ThemeService::ALIGN_TOP) { 142 if (alignment & ThemeService::ALIGN_TOP) {
143 if (alignment & ThemeService::ALIGN_LEFT) 143 if (alignment & ThemeService::ALIGN_LEFT)
144 return "0% " + base::IntToString(-offset) + "px"; 144 return "left " + base::IntToString(-offset) + "px";
145 else if (alignment & ThemeService::ALIGN_RIGHT) 145 else if (alignment & ThemeService::ALIGN_RIGHT)
146 return "100% " + base::IntToString(-offset) + "px"; 146 return "right " + base::IntToString(-offset) + "px";
147 return "center " + base::IntToString(-offset) + "px"; 147 return "center " + base::IntToString(-offset) + "px";
148 } 148 }
149 return ThemeService::AlignmentToString(alignment); 149 return ThemeService::AlignmentToString(alignment);
150 } 150 }
151 151
152 // How the background image on the new tab page should be tiled (see tiling 152 // How the background image on the new tab page should be tiled (see tiling
153 // masks in theme_service.h). 153 // masks in theme_service.h).
154 std::string GetNewTabBackgroundTilingCSS( 154 std::string GetNewTabBackgroundTilingCSS(
155 const ui::ThemeProvider* theme_provider) { 155 const ui::ThemeProvider* theme_provider) {
156 int repeat_mode; 156 int repeat_mode;
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 // Get our template. 516 // Get our template.
517 static const base::StringPiece new_tab_theme_css( 517 static const base::StringPiece new_tab_theme_css(
518 ResourceBundle::GetSharedInstance().GetRawDataResource( 518 ResourceBundle::GetSharedInstance().GetRawDataResource(
519 IDR_NEW_TAB_4_THEME_CSS)); 519 IDR_NEW_TAB_4_THEME_CSS));
520 520
521 // Create the string from our template and the replacements. 521 // Create the string from our template and the replacements.
522 std::string css_string; 522 std::string css_string;
523 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); 523 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL);
524 new_tab_css_ = base::RefCountedString::TakeString(&css_string); 524 new_tab_css_ = base::RefCountedString::TakeString(&css_string);
525 } 525 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698