| 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 19 matching lines...) Expand all Loading... |
| 30 #include "chrome/browser/ui/app_list/app_list_util.h" | 30 #include "chrome/browser/ui/app_list/app_list_util.h" |
| 31 #include "chrome/browser/ui/bookmarks/bookmark_bar_constants.h" | 31 #include "chrome/browser/ui/bookmarks/bookmark_bar_constants.h" |
| 32 #include "chrome/browser/ui/sync/sync_promo_ui.h" | 32 #include "chrome/browser/ui/sync/sync_promo_ui.h" |
| 33 #include "chrome/browser/ui/webui/ntp/new_tab_page_handler.h" | 33 #include "chrome/browser/ui/webui/ntp/new_tab_page_handler.h" |
| 34 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" | 34 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" |
| 35 #include "chrome/browser/ui/webui/ntp/ntp_login_handler.h" | 35 #include "chrome/browser/ui/webui/ntp/ntp_login_handler.h" |
| 36 #include "chrome/browser/ui/webui/sync_setup_handler.h" | 36 #include "chrome/browser/ui/webui/sync_setup_handler.h" |
| 37 #include "chrome/browser/web_resource/notification_promo.h" | 37 #include "chrome/browser/web_resource/notification_promo.h" |
| 38 #include "chrome/common/chrome_switches.h" | 38 #include "chrome/common/chrome_switches.h" |
| 39 #include "chrome/common/extensions/extension.h" | 39 #include "chrome/common/extensions/extension.h" |
| 40 #include "chrome/common/extensions/extension_constants.h" | |
| 41 #include "chrome/common/pref_names.h" | 40 #include "chrome/common/pref_names.h" |
| 42 #include "chrome/common/url_constants.h" | 41 #include "chrome/common/url_constants.h" |
| 43 #include "content/public/browser/browser_thread.h" | 42 #include "content/public/browser/browser_thread.h" |
| 44 #include "content/public/browser/notification_service.h" | 43 #include "content/public/browser/notification_service.h" |
| 45 #include "content/public/browser/render_process_host.h" | 44 #include "content/public/browser/render_process_host.h" |
| 45 #include "extensions/common/extension_urls.h" |
| 46 #include "grit/browser_resources.h" | 46 #include "grit/browser_resources.h" |
| 47 #include "grit/chromium_strings.h" | 47 #include "grit/chromium_strings.h" |
| 48 #include "grit/generated_resources.h" | 48 #include "grit/generated_resources.h" |
| 49 #include "grit/locale_settings.h" | 49 #include "grit/locale_settings.h" |
| 50 #include "grit/theme_resources.h" | 50 #include "grit/theme_resources.h" |
| 51 #include "ui/base/l10n/l10n_util.h" | 51 #include "ui/base/l10n/l10n_util.h" |
| 52 #include "ui/base/resource/resource_bundle.h" | 52 #include "ui/base/resource/resource_bundle.h" |
| 53 #include "ui/base/theme_provider.h" | 53 #include "ui/base/theme_provider.h" |
| 54 #include "ui/base/webui/jstemplate_builder.h" | 54 #include "ui/base/webui/jstemplate_builder.h" |
| 55 #include "ui/base/webui/web_ui_util.h" | 55 #include "ui/base/webui/web_ui_util.h" |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 NTPLoginHandler::ShouldShow(profile_)); | 436 NTPLoginHandler::ShouldShow(profile_)); |
| 437 load_time_data.SetString("otherSessions", | 437 load_time_data.SetString("otherSessions", |
| 438 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_LABEL)); | 438 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_LABEL)); |
| 439 load_time_data.SetString("otherSessionsEmpty", | 439 load_time_data.SetString("otherSessionsEmpty", |
| 440 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_EMPTY)); | 440 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_EMPTY)); |
| 441 load_time_data.SetString("otherSessionsLearnMoreUrl", | 441 load_time_data.SetString("otherSessionsLearnMoreUrl", |
| 442 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_LEARN_MORE_URL)); | 442 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_LEARN_MORE_URL)); |
| 443 load_time_data.SetString("learnMore", | 443 load_time_data.SetString("learnMore", |
| 444 l10n_util::GetStringUTF16(IDS_LEARN_MORE)); | 444 l10n_util::GetStringUTF16(IDS_LEARN_MORE)); |
| 445 load_time_data.SetString("webStoreLink", | 445 load_time_data.SetString("webStoreLink", |
| 446 GetUrlWithLang(GURL(extension_urls::GetWebstoreLaunchURL()))); | 446 GetUrlWithLang(GURL(extensions::GetWebstoreLaunchURL()))); |
| 447 load_time_data.SetString("appInstallHintText", | 447 load_time_data.SetString("appInstallHintText", |
| 448 l10n_util::GetStringUTF16(IDS_NEW_TAB_APP_INSTALL_HINT_LABEL)); | 448 l10n_util::GetStringUTF16(IDS_NEW_TAB_APP_INSTALL_HINT_LABEL)); |
| 449 load_time_data.SetBoolean("isDiscoveryInNTPEnabled", | 449 load_time_data.SetBoolean("isDiscoveryInNTPEnabled", |
| 450 NewTabUI::IsDiscoveryInNTPEnabled()); | 450 NewTabUI::IsDiscoveryInNTPEnabled()); |
| 451 load_time_data.SetString("collapseSessionMenuItemText", | 451 load_time_data.SetString("collapseSessionMenuItemText", |
| 452 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_COLLAPSE_SESSION)); | 452 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_COLLAPSE_SESSION)); |
| 453 load_time_data.SetString("expandSessionMenuItemText", | 453 load_time_data.SetString("expandSessionMenuItemText", |
| 454 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_EXPAND_SESSION)); | 454 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_EXPAND_SESSION)); |
| 455 load_time_data.SetString("restoreSessionMenuItemText", | 455 load_time_data.SetString("restoreSessionMenuItemText", |
| 456 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_OPEN_ALL)); | 456 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_OPEN_ALL)); |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 // Get our template. | 706 // Get our template. |
| 707 static const base::StringPiece new_tab_theme_css( | 707 static const base::StringPiece new_tab_theme_css( |
| 708 ResourceBundle::GetSharedInstance().GetRawDataResource( | 708 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 709 IDR_NEW_TAB_4_THEME_CSS)); | 709 IDR_NEW_TAB_4_THEME_CSS)); |
| 710 | 710 |
| 711 // Create the string from our template and the replacements. | 711 // Create the string from our template and the replacements. |
| 712 std::string css_string; | 712 std::string css_string; |
| 713 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); | 713 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); |
| 714 new_tab_css_ = base::RefCountedString::TakeString(&css_string); | 714 new_tab_css_ = base::RefCountedString::TakeString(&css_string); |
| 715 } | 715 } |
| OLD | NEW |