OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/dom_ui/dom_ui_theme_source.h" | 5 #include "chrome/browser/dom_ui/dom_ui_theme_source.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "app/theme_provider.h" | 9 #include "app/theme_provider.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 177 |
178 subst2.push_back(SkColorToRGBAString(color_section)); // $$1 | 178 subst2.push_back(SkColorToRGBAString(color_section)); // $$1 |
179 subst2.push_back(SkColorToRGBAString(color_section_border)); // $$2 | 179 subst2.push_back(SkColorToRGBAString(color_section_border)); // $$2 |
180 subst2.push_back(SkColorToRGBAString(color_section_text)); // $$3 | 180 subst2.push_back(SkColorToRGBAString(color_section_text)); // $$3 |
181 subst2.push_back(SkColorToRGBAString(color_section_link)); // $$4 | 181 subst2.push_back(SkColorToRGBAString(color_section_link)); // $$4 |
182 subst2.push_back( | 182 subst2.push_back( |
183 tp->HasCustomImage(IDR_THEME_NTP_ATTRIBUTION) ? "block" : "none"); // $$5 | 183 tp->HasCustomImage(IDR_THEME_NTP_ATTRIBUTION) ? "block" : "none"); // $$5 |
184 subst2.push_back(SkColorToRGBAString(color_link_underline)); // $$6 | 184 subst2.push_back(SkColorToRGBAString(color_link_underline)); // $$6 |
185 subst2.push_back(SkColorToRGBAString(color_section_link_underline)); // $$7 | 185 subst2.push_back(SkColorToRGBAString(color_section_link_underline)); // $$7 |
186 | 186 |
187 if (profile->GetPrefs()->GetInteger(prefs::kNTPThemePromoRemaining) > 0) | 187 if (profile->GetPrefs()->GetInteger(prefs::kNTPPromoRemaining) > 0) { |
188 subst2.push_back("block"); // $$8 | 188 subst2.push_back("block"); // $$8 |
189 else | 189 subst2.push_back("inline-block"); // $$9 |
| 190 } else { |
190 subst2.push_back("none"); // $$8 | 191 subst2.push_back("none"); // $$8 |
| 192 subst2.push_back("none"); // $$9 |
| 193 } |
191 | 194 |
192 // Get our template. | 195 // Get our template. |
193 static const base::StringPiece new_tab_theme_css( | 196 static const base::StringPiece new_tab_theme_css( |
194 ResourceBundle::GetSharedInstance().GetRawDataResource( | 197 ResourceBundle::GetSharedInstance().GetRawDataResource( |
195 IDR_NEW_TAB_THEME_CSS)); | 198 IDR_NEW_TAB_THEME_CSS)); |
196 | 199 |
197 // Create the string from our template and the replacements. | 200 // Create the string from our template and the replacements. |
198 const std::string css_string = ReplaceStringPlaceholders( | 201 const std::string css_string = ReplaceStringPlaceholders( |
199 new_tab_theme_css, subst, NULL); | 202 new_tab_theme_css, subst, NULL); |
200 new_tab_css_ = ReplaceStringPlaceholders( | 203 new_tab_css_ = ReplaceStringPlaceholders( |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 return BrowserThemeProvider::AlignmentToString(alignment); | 292 return BrowserThemeProvider::AlignmentToString(alignment); |
290 } | 293 } |
291 | 294 |
292 std::string DOMUIThemeSource::GetNewTabBackgroundTilingCSS() { | 295 std::string DOMUIThemeSource::GetNewTabBackgroundTilingCSS() { |
293 int repeat_mode; | 296 int repeat_mode; |
294 profile_->GetThemeProvider()->GetDisplayProperty( | 297 profile_->GetThemeProvider()->GetDisplayProperty( |
295 BrowserThemeProvider::NTP_BACKGROUND_TILING, &repeat_mode); | 298 BrowserThemeProvider::NTP_BACKGROUND_TILING, &repeat_mode); |
296 return BrowserThemeProvider::TilingToString(repeat_mode); | 299 return BrowserThemeProvider::TilingToString(repeat_mode); |
297 } | 300 } |
298 | 301 |
OLD | NEW |