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::kNTPPromoRemaining) > 0) { | 187 #if defined(OS_MACOSX) |
| 188 // No extensions available on Mac yet. |
| 189 subst2.push_back("none"); // $$8: display of lower right promo image |
| 190 subst2.push_back("none"); // $$9: display of butterbar footer promo line |
| 191 #else |
| 192 if (profile->GetPrefs()->GetInteger(prefs::kNTPPromoImageRemaining) > 0) { |
188 subst2.push_back("block"); // $$8 | 193 subst2.push_back("block"); // $$8 |
| 194 } else { |
| 195 subst2.push_back("none"); // $$8 |
| 196 } |
| 197 if (profile->GetPrefs()->GetInteger(prefs::kNTPPromoLineRemaining) > 0) { |
189 subst2.push_back("inline-block"); // $$9 | 198 subst2.push_back("inline-block"); // $$9 |
190 } else { | 199 } else { |
191 subst2.push_back("none"); // $$8 | |
192 subst2.push_back("none"); // $$9 | 200 subst2.push_back("none"); // $$9 |
193 } | 201 } |
| 202 #endif |
194 | 203 |
195 // Get our template. | 204 // Get our template. |
196 static const base::StringPiece new_tab_theme_css( | 205 static const base::StringPiece new_tab_theme_css( |
197 ResourceBundle::GetSharedInstance().GetRawDataResource( | 206 ResourceBundle::GetSharedInstance().GetRawDataResource( |
198 IDR_NEW_TAB_THEME_CSS)); | 207 IDR_NEW_TAB_THEME_CSS)); |
199 | 208 |
200 // Create the string from our template and the replacements. | 209 // Create the string from our template and the replacements. |
201 const std::string css_string = ReplaceStringPlaceholders( | 210 const std::string css_string = ReplaceStringPlaceholders( |
202 new_tab_theme_css, subst, NULL); | 211 new_tab_theme_css, subst, NULL); |
203 new_tab_css_ = ReplaceStringPlaceholders( | 212 new_tab_css_ = ReplaceStringPlaceholders( |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 return BrowserThemeProvider::AlignmentToString(alignment); | 301 return BrowserThemeProvider::AlignmentToString(alignment); |
293 } | 302 } |
294 | 303 |
295 std::string DOMUIThemeSource::GetNewTabBackgroundTilingCSS() { | 304 std::string DOMUIThemeSource::GetNewTabBackgroundTilingCSS() { |
296 int repeat_mode; | 305 int repeat_mode; |
297 profile_->GetThemeProvider()->GetDisplayProperty( | 306 profile_->GetThemeProvider()->GetDisplayProperty( |
298 BrowserThemeProvider::NTP_BACKGROUND_TILING, &repeat_mode); | 307 BrowserThemeProvider::NTP_BACKGROUND_TILING, &repeat_mode); |
299 return BrowserThemeProvider::TilingToString(repeat_mode); | 308 return BrowserThemeProvider::TilingToString(repeat_mode); |
300 } | 309 } |
301 | 310 |
OLD | NEW |