| 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 profile_->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar) ? | 285 profile_->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar) ? |
| 286 "true" : "false"); | 286 "true" : "false"); |
| 287 localized_strings.SetString("hasattribution", | 287 localized_strings.SetString("hasattribution", |
| 288 ThemeServiceFactory::GetForProfile(profile_)->HasCustomImage( | 288 ThemeServiceFactory::GetForProfile(profile_)->HasCustomImage( |
| 289 IDR_THEME_NTP_ATTRIBUTION) ? | 289 IDR_THEME_NTP_ATTRIBUTION) ? |
| 290 "true" : "false"); | 290 "true" : "false"); |
| 291 localized_strings.SetString("title", | 291 localized_strings.SetString("title", |
| 292 l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE)); | 292 l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE)); |
| 293 localized_strings.SetString("mostvisited", | 293 localized_strings.SetString("mostvisited", |
| 294 l10n_util::GetStringUTF16(IDS_NEW_TAB_MOST_VISITED)); | 294 l10n_util::GetStringUTF16(IDS_NEW_TAB_MOST_VISITED)); |
| 295 localized_strings.SetString("suggested", |
| 296 l10n_util::GetStringUTF16(IDS_NEW_TAB_SUGGESTED)); |
| 295 localized_strings.SetString("restoreThumbnailsShort", | 297 localized_strings.SetString("restoreThumbnailsShort", |
| 296 l10n_util::GetStringUTF16(IDS_NEW_TAB_RESTORE_THUMBNAILS_SHORT_LINK)); | 298 l10n_util::GetStringUTF16(IDS_NEW_TAB_RESTORE_THUMBNAILS_SHORT_LINK)); |
| 297 localized_strings.SetString("recentlyclosed", | 299 localized_strings.SetString("recentlyclosed", |
| 298 l10n_util::GetStringUTF16(IDS_NEW_TAB_RECENTLY_CLOSED)); | 300 l10n_util::GetStringUTF16(IDS_NEW_TAB_RECENTLY_CLOSED)); |
| 299 localized_strings.SetString("webStoreTitle", | 301 localized_strings.SetString("webStoreTitle", |
| 300 l10n_util::GetStringUTF16(IDS_EXTENSION_WEB_STORE_TITLE)); | 302 l10n_util::GetStringUTF16(IDS_EXTENSION_WEB_STORE_TITLE)); |
| 301 localized_strings.SetString("closedwindowsingle", | 303 localized_strings.SetString("closedwindowsingle", |
| 302 l10n_util::GetStringUTF16(IDS_NEW_TAB_RECENTLY_CLOSED_WINDOW_SINGLE)); | 304 l10n_util::GetStringUTF16(IDS_NEW_TAB_RECENTLY_CLOSED_WINDOW_SINGLE)); |
| 303 localized_strings.SetString("closedwindowmultiple", | 305 localized_strings.SetString("closedwindowmultiple", |
| 304 l10n_util::GetStringUTF16(IDS_NEW_TAB_RECENTLY_CLOSED_WINDOW_MULTIPLE)); | 306 l10n_util::GetStringUTF16(IDS_NEW_TAB_RECENTLY_CLOSED_WINDOW_MULTIPLE)); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 334 l10n_util::GetStringUTF16(IDS_SYNC_ADVANCED_OPTIONS)); | 336 l10n_util::GetStringUTF16(IDS_SYNC_ADVANCED_OPTIONS)); |
| 335 localized_strings.SetString("webStoreLink", | 337 localized_strings.SetString("webStoreLink", |
| 336 GetUrlWithLang(GURL(extension_urls::GetWebstoreLaunchURL()))); | 338 GetUrlWithLang(GURL(extension_urls::GetWebstoreLaunchURL()))); |
| 337 localized_strings.SetBoolean("isWebStoreExperimentEnabled", | 339 localized_strings.SetBoolean("isWebStoreExperimentEnabled", |
| 338 NewTabUI::IsWebStoreExperimentEnabled()); | 340 NewTabUI::IsWebStoreExperimentEnabled()); |
| 339 localized_strings.SetString("appInstallHintUrl", | 341 localized_strings.SetString("appInstallHintUrl", |
| 340 chrome::kNtpAppInstallHintURL); | 342 chrome::kNtpAppInstallHintURL); |
| 341 localized_strings.SetBoolean("appInstallHintEnabled", | 343 localized_strings.SetBoolean("appInstallHintEnabled", |
| 342 CommandLine::ForCurrentProcess()->HasSwitch( | 344 CommandLine::ForCurrentProcess()->HasSwitch( |
| 343 switches::kNtpAppInstallHint)); | 345 switches::kNtpAppInstallHint)); |
| 346 localized_strings.SetBoolean("isSuggestedPageEnabled", |
| 347 NewTabUI::IsSuggestedPageEnabled()); |
| 344 | 348 |
| 345 #if defined(OS_CHROMEOS) | 349 #if defined(OS_CHROMEOS) |
| 346 localized_strings.SetString("expandMenu", | 350 localized_strings.SetString("expandMenu", |
| 347 l10n_util::GetStringUTF16(IDS_NEW_TAB_CLOSE_MENU_EXPAND)); | 351 l10n_util::GetStringUTF16(IDS_NEW_TAB_CLOSE_MENU_EXPAND)); |
| 348 #endif | 352 #endif |
| 349 | 353 |
| 350 NewTabPageHandler::GetLocalizedValues(profile_, &localized_strings); | 354 NewTabPageHandler::GetLocalizedValues(profile_, &localized_strings); |
| 351 NTPLoginHandler::GetLocalizedValues(profile_, &localized_strings); | 355 NTPLoginHandler::GetLocalizedValues(profile_, &localized_strings); |
| 352 | 356 |
| 353 // Don't initiate the sync related message passing with the page if the sync | 357 // Don't initiate the sync related message passing with the page if the sync |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 // Get our template. | 521 // Get our template. |
| 518 static const base::StringPiece new_tab_theme_css( | 522 static const base::StringPiece new_tab_theme_css( |
| 519 ResourceBundle::GetSharedInstance().GetRawDataResource( | 523 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 520 IDR_NEW_TAB_4_THEME_CSS)); | 524 IDR_NEW_TAB_4_THEME_CSS)); |
| 521 | 525 |
| 522 // Create the string from our template and the replacements. | 526 // Create the string from our template and the replacements. |
| 523 std::string css_string; | 527 std::string css_string; |
| 524 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); | 528 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); |
| 525 new_tab_css_ = base::RefCountedString::TakeString(&css_string); | 529 new_tab_css_ = base::RefCountedString::TakeString(&css_string); |
| 526 } | 530 } |
| OLD | NEW |