| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 } | 390 } |
| 391 | 391 |
| 392 // If the user has preferences for a start and end time for a promo from | 392 // If the user has preferences for a start and end time for a promo from |
| 393 // the server, and this promo string exists, set the localized string. | 393 // the server, and this promo string exists, set the localized string. |
| 394 if (PromoResourceService::CanShowNotificationPromo(profile_)) { | 394 if (PromoResourceService::CanShowNotificationPromo(profile_)) { |
| 395 localized_strings.SetString("serverpromo", | 395 localized_strings.SetString("serverpromo", |
| 396 profile_->GetPrefs()->GetString(prefs::kNtpPromoLine)); | 396 profile_->GetPrefs()->GetString(prefs::kNtpPromoLine)); |
| 397 } | 397 } |
| 398 | 398 |
| 399 // Determine whether to show the menu for accessing tabs on other devices. | 399 // Determine whether to show the menu for accessing tabs on other devices. |
| 400 bool show_other_sessions_menu = !CommandLine::ForCurrentProcess()->HasSwitch( | 400 bool show_other_sessions_menu = CommandLine::ForCurrentProcess()->HasSwitch( |
| 401 switches::kDisableNTPOtherSessionsMenu); | 401 switches::kEnableNTPOtherSessionsMenu); |
| 402 localized_strings.SetBoolean("showOtherSessionsMenu", | 402 localized_strings.SetBoolean("showOtherSessionsMenu", |
| 403 show_other_sessions_menu); | 403 show_other_sessions_menu); |
| 404 | 404 |
| 405 // Load the new tab page appropriate for this build | 405 // Load the new tab page appropriate for this build |
| 406 std::string full_html; | 406 std::string full_html; |
| 407 base::StringPiece new_tab_html(ResourceBundle::GetSharedInstance(). | 407 base::StringPiece new_tab_html(ResourceBundle::GetSharedInstance(). |
| 408 GetRawDataResource(IDR_NEW_TAB_4_HTML)); | 408 GetRawDataResource(IDR_NEW_TAB_4_HTML)); |
| 409 full_html = jstemplate_builder::GetI18nTemplateHtml(new_tab_html, | 409 full_html = jstemplate_builder::GetI18nTemplateHtml(new_tab_html, |
| 410 &localized_strings); | 410 &localized_strings); |
| 411 new_tab_html_ = base::RefCountedString::TakeString(&full_html); | 411 new_tab_html_ = base::RefCountedString::TakeString(&full_html); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 // Get our template. | 530 // Get our template. |
| 531 static const base::StringPiece new_tab_theme_css( | 531 static const base::StringPiece new_tab_theme_css( |
| 532 ResourceBundle::GetSharedInstance().GetRawDataResource( | 532 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 533 IDR_NEW_TAB_4_THEME_CSS)); | 533 IDR_NEW_TAB_4_THEME_CSS)); |
| 534 | 534 |
| 535 // Create the string from our template and the replacements. | 535 // Create the string from our template and the replacements. |
| 536 std::string css_string; | 536 std::string css_string; |
| 537 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); | 537 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); |
| 538 new_tab_css_ = base::RefCountedString::TakeString(&css_string); | 538 new_tab_css_ = base::RefCountedString::TakeString(&css_string); |
| 539 } | 539 } |
| OLD | NEW |