| 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/ntp_resource_cache.h" | 5 #include "chrome/browser/dom_ui/ntp_resource_cache.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "app/animation.h" | 10 #include "app/animation.h" |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 | 299 |
| 300 ChromeURLDataManager::DataSource::SetFontAndTextDirection(&localized_strings); | 300 ChromeURLDataManager::DataSource::SetFontAndTextDirection(&localized_strings); |
| 301 | 301 |
| 302 // Control fade and resize animations. | 302 // Control fade and resize animations. |
| 303 std::string anim = | 303 std::string anim = |
| 304 Animation::ShouldRenderRichAnimation() ? "true" : "false"; | 304 Animation::ShouldRenderRichAnimation() ? "true" : "false"; |
| 305 localized_strings.SetString("anim", anim); | 305 localized_strings.SetString("anim", anim); |
| 306 | 306 |
| 307 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 307 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 308 bool has_3d = | 308 bool has_3d = |
| 309 command_line->HasSwitch(switches::kEnableAcceleratedCompositing); | 309 !command_line->HasSwitch(switches::kDisableAcceleratedCompositing); |
| 310 localized_strings.SetString("has_3d", has_3d ? "true" : "false"); | 310 localized_strings.SetString("has_3d", has_3d ? "true" : "false"); |
| 311 | 311 |
| 312 // Pass the shown_sections pref early so that we can prevent flicker. | 312 // Pass the shown_sections pref early so that we can prevent flicker. |
| 313 const int shown_sections = ShownSectionsHandler::GetShownSections( | 313 const int shown_sections = ShownSectionsHandler::GetShownSections( |
| 314 profile_->GetPrefs()); | 314 profile_->GetPrefs()); |
| 315 localized_strings.SetInteger("shown_sections", shown_sections); | 315 localized_strings.SetInteger("shown_sections", shown_sections); |
| 316 | 316 |
| 317 base::StringPiece new_tab_html(ResourceBundle::GetSharedInstance(). | 317 base::StringPiece new_tab_html(ResourceBundle::GetSharedInstance(). |
| 318 GetRawDataResource(IDR_NEW_NEW_TAB_HTML)); | 318 GetRawDataResource(IDR_NEW_NEW_TAB_HTML)); |
| 319 | 319 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 std::string css_string; | 475 std::string css_string; |
| 476 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); | 476 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); |
| 477 css_string = ReplaceStringPlaceholders(css_string, subst2, NULL); | 477 css_string = ReplaceStringPlaceholders(css_string, subst2, NULL); |
| 478 css_string = ReplaceStringPlaceholders(css_string, subst3, NULL); | 478 css_string = ReplaceStringPlaceholders(css_string, subst3, NULL); |
| 479 | 479 |
| 480 new_tab_css_ = new RefCountedBytes; | 480 new_tab_css_ = new RefCountedBytes; |
| 481 new_tab_css_->data.resize(css_string.size()); | 481 new_tab_css_->data.resize(css_string.size()); |
| 482 std::copy(css_string.begin(), css_string.end(), | 482 std::copy(css_string.begin(), css_string.end(), |
| 483 new_tab_css_->data.begin()); | 483 new_tab_css_->data.begin()); |
| 484 } | 484 } |
| OLD | NEW |