OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 else | 378 else |
379 localized_strings.SetString("syncispresent", "false"); | 379 localized_strings.SetString("syncispresent", "false"); |
380 | 380 |
381 ChromeURLDataManager::DataSource::SetFontAndTextDirection(&localized_strings); | 381 ChromeURLDataManager::DataSource::SetFontAndTextDirection(&localized_strings); |
382 | 382 |
383 // Control fade and resize animations. | 383 // Control fade and resize animations. |
384 std::string anim = | 384 std::string anim = |
385 ui::Animation::ShouldRenderRichAnimation() ? "true" : "false"; | 385 ui::Animation::ShouldRenderRichAnimation() ? "true" : "false"; |
386 localized_strings.SetString("anim", anim); | 386 localized_strings.SetString("anim", anim); |
387 | 387 |
| 388 int alignment; |
| 389 ui::ThemeProvider* tp = ThemeServiceFactory::GetForProfile(profile_); |
| 390 tp->GetDisplayProperty(ThemeService::NTP_BACKGROUND_ALIGNMENT, &alignment); |
| 391 if (alignment & ThemeService::ALIGN_RIGHT) |
| 392 localized_strings.SetString("themegravity", "right"); |
| 393 |
388 // Pass the shown_sections pref early so that we can prevent flicker. | 394 // Pass the shown_sections pref early so that we can prevent flicker. |
389 const int shown_sections = ShownSectionsHandler::GetShownSections( | 395 const int shown_sections = ShownSectionsHandler::GetShownSections( |
390 profile_->GetPrefs()); | 396 profile_->GetPrefs()); |
391 localized_strings.SetInteger("shown_sections", shown_sections); | 397 localized_strings.SetInteger("shown_sections", shown_sections); |
392 | 398 |
393 // If the user has preferences for a start and end time for a custom logo, | 399 // If the user has preferences for a start and end time for a custom logo, |
394 // and the time now is between these two times, show the custom logo. | 400 // and the time now is between these two times, show the custom logo. |
395 if (profile_->GetPrefs()->FindPreference(prefs::kNTPCustomLogoStart) && | 401 if (profile_->GetPrefs()->FindPreference(prefs::kNTPCustomLogoStart) && |
396 profile_->GetPrefs()->FindPreference(prefs::kNTPCustomLogoEnd)) { | 402 profile_->GetPrefs()->FindPreference(prefs::kNTPCustomLogoEnd)) { |
397 localized_strings.SetString("customlogo", | 403 localized_strings.SetString("customlogo", |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 IDR_NEW_TAB_4_THEME_CSS : IDR_NEW_TAB_THEME_CSS; | 581 IDR_NEW_TAB_4_THEME_CSS : IDR_NEW_TAB_THEME_CSS; |
576 static const base::StringPiece new_tab_theme_css( | 582 static const base::StringPiece new_tab_theme_css( |
577 ResourceBundle::GetSharedInstance().GetRawDataResource( | 583 ResourceBundle::GetSharedInstance().GetRawDataResource( |
578 ntp_css_resource_id)); | 584 ntp_css_resource_id)); |
579 | 585 |
580 // Create the string from our template and the replacements. | 586 // Create the string from our template and the replacements. |
581 std::string css_string; | 587 std::string css_string; |
582 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); | 588 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); |
583 new_tab_css_ = base::RefCountedString::TakeString(&css_string); | 589 new_tab_css_ = base::RefCountedString::TakeString(&css_string); |
584 } | 590 } |
OLD | NEW |