| 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("suggestions", |
| 296 l10n_util::GetStringUTF16(IDS_NEW_TAB_SUGGESTIONS)); |
| 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("webStoreTitleShort", | 303 localized_strings.SetString("webStoreTitleShort", |
| 302 l10n_util::GetStringUTF16(IDS_EXTENSION_WEB_STORE_TITLE_SHORT)); | 304 l10n_util::GetStringUTF16(IDS_EXTENSION_WEB_STORE_TITLE_SHORT)); |
| 303 localized_strings.SetString("closedwindowsingle", | 305 localized_strings.SetString("closedwindowsingle", |
| 304 l10n_util::GetStringUTF16(IDS_NEW_TAB_RECENTLY_CLOSED_WINDOW_SINGLE)); | 306 l10n_util::GetStringUTF16(IDS_NEW_TAB_RECENTLY_CLOSED_WINDOW_SINGLE)); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 333 localized_strings.SetString("syncpromotext", | 335 localized_strings.SetString("syncpromotext", |
| 334 l10n_util::GetStringUTF16(IDS_SYNC_START_SYNC_BUTTON_LABEL)); | 336 l10n_util::GetStringUTF16(IDS_SYNC_START_SYNC_BUTTON_LABEL)); |
| 335 localized_strings.SetString("syncLinkText", | 337 localized_strings.SetString("syncLinkText", |
| 336 l10n_util::GetStringUTF16(IDS_SYNC_ADVANCED_OPTIONS)); | 338 l10n_util::GetStringUTF16(IDS_SYNC_ADVANCED_OPTIONS)); |
| 337 localized_strings.SetString("webStoreLink", | 339 localized_strings.SetString("webStoreLink", |
| 338 GetUrlWithLang(GURL(extension_urls::GetWebstoreLaunchURL()))); | 340 GetUrlWithLang(GURL(extension_urls::GetWebstoreLaunchURL()))); |
| 339 localized_strings.SetBoolean("isWebStoreExperimentEnabled", | 341 localized_strings.SetBoolean("isWebStoreExperimentEnabled", |
| 340 NewTabUI::ShouldShowWebStoreFooterLink()); | 342 NewTabUI::ShouldShowWebStoreFooterLink()); |
| 341 localized_strings.SetBoolean("appInstallHintEnabled", | 343 localized_strings.SetBoolean("appInstallHintEnabled", |
| 342 NewTabUI::ShouldShowAppInstallHint()); | 344 NewTabUI::ShouldShowAppInstallHint()); |
| 345 localized_strings.SetBoolean("isSuggestionsPageEnabled", |
| 346 NewTabUI::IsSuggestionsPageEnabled()); |
| 343 | 347 |
| 344 #if defined(OS_CHROMEOS) | 348 #if defined(OS_CHROMEOS) |
| 345 localized_strings.SetString("expandMenu", | 349 localized_strings.SetString("expandMenu", |
| 346 l10n_util::GetStringUTF16(IDS_NEW_TAB_CLOSE_MENU_EXPAND)); | 350 l10n_util::GetStringUTF16(IDS_NEW_TAB_CLOSE_MENU_EXPAND)); |
| 347 #endif | 351 #endif |
| 348 | 352 |
| 349 NewTabPageHandler::GetLocalizedValues(profile_, &localized_strings); | 353 NewTabPageHandler::GetLocalizedValues(profile_, &localized_strings); |
| 350 NTPLoginHandler::GetLocalizedValues(profile_, &localized_strings); | 354 NTPLoginHandler::GetLocalizedValues(profile_, &localized_strings); |
| 351 | 355 |
| 352 // Don't initiate the sync related message passing with the page if the sync | 356 // 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... |
| 516 // Get our template. | 520 // Get our template. |
| 517 static const base::StringPiece new_tab_theme_css( | 521 static const base::StringPiece new_tab_theme_css( |
| 518 ResourceBundle::GetSharedInstance().GetRawDataResource( | 522 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 519 IDR_NEW_TAB_4_THEME_CSS)); | 523 IDR_NEW_TAB_4_THEME_CSS)); |
| 520 | 524 |
| 521 // Create the string from our template and the replacements. | 525 // Create the string from our template and the replacements. |
| 522 std::string css_string; | 526 std::string css_string; |
| 523 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); | 527 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); |
| 524 new_tab_css_ = base::RefCountedString::TakeString(&css_string); | 528 new_tab_css_ = base::RefCountedString::TakeString(&css_string); |
| 525 } | 529 } |
| OLD | NEW |