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 <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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 // feature is enabled. | 494 // feature is enabled. |
495 load_time_data.SetBoolean("isSwipeTrackingFromScrollEventsEnabled", | 495 load_time_data.SetBoolean("isSwipeTrackingFromScrollEventsEnabled", |
496 is_swipe_tracking_from_scroll_events_enabled_); | 496 is_swipe_tracking_from_scroll_events_enabled_); |
497 | 497 |
498 load_time_data.SetBoolean("showApps", should_show_apps_page_); | 498 load_time_data.SetBoolean("showApps", should_show_apps_page_); |
499 load_time_data.SetBoolean("showWebStoreIcon", | 499 load_time_data.SetBoolean("showWebStoreIcon", |
500 !prefs->GetBoolean(prefs::kHideWebStoreIcon)); | 500 !prefs->GetBoolean(prefs::kHideWebStoreIcon)); |
501 | 501 |
502 bool bookmark_apps_enabled = extensions::util::IsNewBookmarkAppsEnabled(); | 502 bool bookmark_apps_enabled = extensions::util::IsNewBookmarkAppsEnabled(); |
503 load_time_data.SetBoolean("enableNewBookmarkApps", bookmark_apps_enabled); | 503 load_time_data.SetBoolean("enableNewBookmarkApps", bookmark_apps_enabled); |
504 // Use a different string for launching as a regular tab when bookmark apps | |
505 // are enabled. | |
506 if (bookmark_apps_enabled) { | |
507 load_time_data.SetString("applaunchtypetab", | |
508 l10n_util::GetStringUTF16(IDS_APP_CONTEXT_MENU_OPEN_TAB)); | |
509 } | |
510 | 504 |
511 #if defined(OS_CHROMEOS) | 505 #if defined(OS_CHROMEOS) |
512 load_time_data.SetString("expandMenu", | 506 load_time_data.SetString("expandMenu", |
513 l10n_util::GetStringUTF16(IDS_NEW_TAB_CLOSE_MENU_EXPAND)); | 507 l10n_util::GetStringUTF16(IDS_NEW_TAB_CLOSE_MENU_EXPAND)); |
514 #endif | 508 #endif |
515 | 509 |
516 NewTabPageHandler::GetLocalizedValues(profile_, &load_time_data); | 510 NewTabPageHandler::GetLocalizedValues(profile_, &load_time_data); |
517 NTPLoginHandler::GetLocalizedValues(profile_, &load_time_data); | 511 NTPLoginHandler::GetLocalizedValues(profile_, &load_time_data); |
518 | 512 |
519 webui::SetLoadTimeDataDefaults(app_locale, &load_time_data); | 513 webui::SetLoadTimeDataDefaults(app_locale, &load_time_data); |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 // Get our template. | 714 // Get our template. |
721 static const base::StringPiece new_tab_theme_css( | 715 static const base::StringPiece new_tab_theme_css( |
722 ResourceBundle::GetSharedInstance().GetRawDataResource( | 716 ResourceBundle::GetSharedInstance().GetRawDataResource( |
723 IDR_NEW_TAB_4_THEME_CSS)); | 717 IDR_NEW_TAB_4_THEME_CSS)); |
724 | 718 |
725 // Create the string from our template and the replacements. | 719 // Create the string from our template and the replacements. |
726 std::string css_string; | 720 std::string css_string; |
727 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); | 721 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); |
728 new_tab_css_ = base::RefCountedString::TakeString(&css_string); | 722 new_tab_css_ = base::RefCountedString::TakeString(&css_string); |
729 } | 723 } |
OLD | NEW |