| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 // Cache-buster for background. | 569 // Cache-buster for background. |
| 570 substitutions["themeId"] = | 570 substitutions["themeId"] = |
| 571 profile_->GetPrefs()->GetString(prefs::kCurrentThemeID); | 571 profile_->GetPrefs()->GetString(prefs::kCurrentThemeID); |
| 572 | 572 |
| 573 // Colors. | 573 // Colors. |
| 574 substitutions["colorBackground"] = SkColorToRGBAString(color_background); | 574 substitutions["colorBackground"] = SkColorToRGBAString(color_background); |
| 575 substitutions["backgroundBarDetached"] = GetNewTabBackgroundCSS(tp, false); | 575 substitutions["backgroundBarDetached"] = GetNewTabBackgroundCSS(tp, false); |
| 576 substitutions["backgroundBarAttached"] = GetNewTabBackgroundCSS(tp, true); | 576 substitutions["backgroundBarAttached"] = GetNewTabBackgroundCSS(tp, true); |
| 577 substitutions["backgroundTiling"] = GetNewTabBackgroundTilingCSS(tp); | 577 substitutions["backgroundTiling"] = GetNewTabBackgroundTilingCSS(tp); |
| 578 substitutions["colorTextRgba"] = SkColorToRGBAString(color_text); | 578 substitutions["colorTextRgba"] = SkColorToRGBAString(color_text); |
| 579 substitutions["colorSectionBorder"] = | |
| 580 SkColorToRGBAString(color_section_border); | |
| 581 substitutions["colorTextLight"] = SkColorToRGBAString(color_text_light); | 579 substitutions["colorTextLight"] = SkColorToRGBAString(color_text_light); |
| 582 substitutions["colorSectionBorder"] = | 580 substitutions["colorSectionBorder"] = |
| 583 SkColorToRGBComponents(color_section_border); | 581 SkColorToRGBComponents(color_section_border); |
| 584 substitutions["colorText"] = SkColorToRGBComponents(color_text); | 582 substitutions["colorText"] = SkColorToRGBComponents(color_text); |
| 585 | 583 |
| 586 // For themes that right-align the background, we flip the attribution to the | 584 // For themes that right-align the background, we flip the attribution to the |
| 587 // left to avoid conflicts. | 585 // left to avoid conflicts. |
| 588 int alignment = | 586 int alignment = |
| 589 tp.GetDisplayProperty(ThemeProperties::NTP_BACKGROUND_ALIGNMENT); | 587 tp.GetDisplayProperty(ThemeProperties::NTP_BACKGROUND_ALIGNMENT); |
| 590 if (alignment & ThemeProperties::ALIGN_RIGHT) { | 588 if (alignment & ThemeProperties::ALIGN_RIGHT) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 603 // Get our template. | 601 // Get our template. |
| 604 static const base::StringPiece new_tab_theme_css( | 602 static const base::StringPiece new_tab_theme_css( |
| 605 ResourceBundle::GetSharedInstance().GetRawDataResource( | 603 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 606 IDR_NEW_TAB_4_THEME_CSS)); | 604 IDR_NEW_TAB_4_THEME_CSS)); |
| 607 | 605 |
| 608 // Create the string from our template and the replacements. | 606 // Create the string from our template and the replacements. |
| 609 std::string css_string = | 607 std::string css_string = |
| 610 ui::ReplaceTemplateExpressions(new_tab_theme_css, substitutions); | 608 ui::ReplaceTemplateExpressions(new_tab_theme_css, substitutions); |
| 611 new_tab_css_ = base::RefCountedString::TakeString(&css_string); | 609 new_tab_css_ = base::RefCountedString::TakeString(&css_string); |
| 612 } | 610 } |
| OLD | NEW |