Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: chrome/browser/ui/webui/ntp/ntp_resource_cache.cc

Issue 1141843004: NTP Zombie Code Slayer II: Suggestions Page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: and remove urls Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 load_time_data.SetBoolean("hasattribution", 414 load_time_data.SetBoolean("hasattribution",
415 ThemeServiceFactory::GetForProfile(profile_)->HasCustomImage( 415 ThemeServiceFactory::GetForProfile(profile_)->HasCustomImage(
416 IDR_THEME_NTP_ATTRIBUTION)); 416 IDR_THEME_NTP_ATTRIBUTION));
417 load_time_data.SetBoolean("showMostvisited", should_show_most_visited_page_); 417 load_time_data.SetBoolean("showMostvisited", should_show_most_visited_page_);
418 load_time_data.SetBoolean("showAppLauncherPromo", 418 load_time_data.SetBoolean("showAppLauncherPromo",
419 ShouldShowAppLauncherPromo()); 419 ShouldShowAppLauncherPromo());
420 load_time_data.SetString("title", 420 load_time_data.SetString("title",
421 l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE)); 421 l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE));
422 load_time_data.SetString("mostvisited", 422 load_time_data.SetString("mostvisited",
423 l10n_util::GetStringUTF16(IDS_NEW_TAB_MOST_VISITED)); 423 l10n_util::GetStringUTF16(IDS_NEW_TAB_MOST_VISITED));
424 load_time_data.SetString("suggestions",
425 l10n_util::GetStringUTF16(IDS_NEW_TAB_SUGGESTIONS));
426 load_time_data.SetString("restoreThumbnailsShort", 424 load_time_data.SetString("restoreThumbnailsShort",
427 l10n_util::GetStringUTF16(IDS_NEW_TAB_RESTORE_THUMBNAILS_SHORT_LINK)); 425 l10n_util::GetStringUTF16(IDS_NEW_TAB_RESTORE_THUMBNAILS_SHORT_LINK));
428 load_time_data.SetString("webStoreTitle", 426 load_time_data.SetString("webStoreTitle",
429 l10n_util::GetStringUTF16(IDS_EXTENSION_WEB_STORE_TITLE)); 427 l10n_util::GetStringUTF16(IDS_EXTENSION_WEB_STORE_TITLE));
430 load_time_data.SetString("webStoreTitleShort", 428 load_time_data.SetString("webStoreTitleShort",
431 l10n_util::GetStringUTF16(IDS_EXTENSION_WEB_STORE_TITLE_SHORT)); 429 l10n_util::GetStringUTF16(IDS_EXTENSION_WEB_STORE_TITLE_SHORT));
432 load_time_data.SetString("attributionintro", 430 load_time_data.SetString("attributionintro",
433 l10n_util::GetStringUTF16(IDS_NEW_TAB_ATTRIBUTION_INTRO)); 431 l10n_util::GetStringUTF16(IDS_NEW_TAB_ATTRIBUTION_INTRO));
434 load_time_data.SetString("thumbnailremovednotification", 432 load_time_data.SetString("thumbnailremovednotification",
435 l10n_util::GetStringUTF16(IDS_NEW_TAB_THUMBNAIL_REMOVED_NOTIFICATION)); 433 l10n_util::GetStringUTF16(IDS_NEW_TAB_THUMBNAIL_REMOVED_NOTIFICATION));
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 load_time_data.SetString("otherSessionsLearnMoreUrl", 468 load_time_data.SetString("otherSessionsLearnMoreUrl",
471 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_LEARN_MORE_URL)); 469 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_LEARN_MORE_URL));
472 load_time_data.SetString("learnMore", 470 load_time_data.SetString("learnMore",
473 l10n_util::GetStringUTF16(IDS_LEARN_MORE)); 471 l10n_util::GetStringUTF16(IDS_LEARN_MORE));
474 const std::string& app_locale = g_browser_process->GetApplicationLocale(); 472 const std::string& app_locale = g_browser_process->GetApplicationLocale();
475 load_time_data.SetString("webStoreLink", 473 load_time_data.SetString("webStoreLink",
476 google_util::AppendGoogleLocaleParam( 474 google_util::AppendGoogleLocaleParam(
477 GURL(extension_urls::GetWebstoreLaunchURL()), app_locale).spec()); 475 GURL(extension_urls::GetWebstoreLaunchURL()), app_locale).spec());
478 load_time_data.SetString("appInstallHintText", 476 load_time_data.SetString("appInstallHintText",
479 l10n_util::GetStringUTF16(IDS_NEW_TAB_APP_INSTALL_HINT_LABEL)); 477 l10n_util::GetStringUTF16(IDS_NEW_TAB_APP_INSTALL_HINT_LABEL));
480 load_time_data.SetBoolean("isDiscoveryInNTPEnabled",
481 NewTabUI::IsDiscoveryInNTPEnabled());
482 load_time_data.SetString("collapseSessionMenuItemText", 478 load_time_data.SetString("collapseSessionMenuItemText",
483 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_COLLAPSE_SESSION)); 479 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_COLLAPSE_SESSION));
484 load_time_data.SetString("expandSessionMenuItemText", 480 load_time_data.SetString("expandSessionMenuItemText",
485 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_EXPAND_SESSION)); 481 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_EXPAND_SESSION));
486 load_time_data.SetString("restoreSessionMenuItemText", 482 load_time_data.SetString("restoreSessionMenuItemText",
487 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_OPEN_ALL)); 483 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_OPEN_ALL));
488 load_time_data.SetString("learn_more", 484 load_time_data.SetString("learn_more",
489 l10n_util::GetStringUTF16(IDS_LEARN_MORE)); 485 l10n_util::GetStringUTF16(IDS_LEARN_MORE));
490 load_time_data.SetString("tile_grid_screenreader_accessible_description", 486 load_time_data.SetString("tile_grid_screenreader_accessible_description",
491 l10n_util::GetStringUTF16(IDS_NEW_TAB_TILE_GRID_ACCESSIBLE_DESCRIPTION)); 487 l10n_util::GetStringUTF16(IDS_NEW_TAB_TILE_GRID_ACCESSIBLE_DESCRIPTION));
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 // Get our template. 719 // Get our template.
724 static const base::StringPiece new_tab_theme_css( 720 static const base::StringPiece new_tab_theme_css(
725 ResourceBundle::GetSharedInstance().GetRawDataResource( 721 ResourceBundle::GetSharedInstance().GetRawDataResource(
726 IDR_NEW_TAB_4_THEME_CSS)); 722 IDR_NEW_TAB_4_THEME_CSS));
727 723
728 // Create the string from our template and the replacements. 724 // Create the string from our template and the replacements.
729 std::string css_string; 725 std::string css_string;
730 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); 726 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL);
731 new_tab_css_ = base::RefCountedString::TakeString(&css_string); 727 new_tab_css_ = base::RefCountedString::TakeString(&css_string);
732 } 728 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/new_tab_ui.cc ('k') | chrome/browser/ui/webui/ntp/suggestions_combiner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698