OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 12 matching lines...) Expand all Loading... |
23 #include "chrome/browser/signin/signin_manager_factory.h" | 23 #include "chrome/browser/signin/signin_manager_factory.h" |
24 #include "chrome/browser/sync/profile_sync_service_factory.h" | 24 #include "chrome/browser/sync/profile_sync_service_factory.h" |
25 #include "chrome/browser/themes/theme_properties.h" | 25 #include "chrome/browser/themes/theme_properties.h" |
26 #include "chrome/browser/themes/theme_service.h" | 26 #include "chrome/browser/themes/theme_service.h" |
27 #include "chrome/browser/themes/theme_service_factory.h" | 27 #include "chrome/browser/themes/theme_service_factory.h" |
28 #include "chrome/browser/ui/app_list/app_list_util.h" | 28 #include "chrome/browser/ui/app_list/app_list_util.h" |
29 #include "chrome/browser/ui/apps/app_info_dialog.h" | 29 #include "chrome/browser/ui/apps/app_info_dialog.h" |
30 #include "chrome/browser/ui/bookmarks/bookmark_bar_constants.h" | 30 #include "chrome/browser/ui/bookmarks/bookmark_bar_constants.h" |
31 #include "chrome/browser/ui/sync/sync_promo_ui.h" | 31 #include "chrome/browser/ui/sync/sync_promo_ui.h" |
32 #include "chrome/browser/ui/webui/app_launcher_login_handler.h" | 32 #include "chrome/browser/ui/webui/app_launcher_login_handler.h" |
33 #include "chrome/browser/ui/webui/ntp/new_tab_page_handler.h" | 33 #include "chrome/browser/ui/webui/ntp/app_launcher_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/common/chrome_switches.h" | 35 #include "chrome/common/chrome_switches.h" |
36 #include "chrome/common/pref_names.h" | 36 #include "chrome/common/pref_names.h" |
37 #include "chrome/common/url_constants.h" | 37 #include "chrome/common/url_constants.h" |
38 #include "chrome/grit/chromium_strings.h" | 38 #include "chrome/grit/chromium_strings.h" |
39 #include "chrome/grit/generated_resources.h" | 39 #include "chrome/grit/generated_resources.h" |
40 #include "chrome/grit/locale_settings.h" | 40 #include "chrome/grit/locale_settings.h" |
41 #include "components/bookmarks/common/bookmark_pref_names.h" | 41 #include "components/bookmarks/common/bookmark_pref_names.h" |
42 #include "components/browser_sync/browser/profile_sync_service.h" | 42 #include "components/browser_sync/browser/profile_sync_service.h" |
43 #include "components/google/core/browser/google_util.h" | 43 #include "components/google/core/browser/google_util.h" |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 | 472 |
473 load_time_data.SetBoolean("enableNewBookmarkApps", | 473 load_time_data.SetBoolean("enableNewBookmarkApps", |
474 extensions::util::IsNewBookmarkAppsEnabled()); | 474 extensions::util::IsNewBookmarkAppsEnabled()); |
475 | 475 |
476 load_time_data.SetBoolean("canHostedAppsOpenInWindows", | 476 load_time_data.SetBoolean("canHostedAppsOpenInWindows", |
477 extensions::util::CanHostedAppsOpenInWindows()); | 477 extensions::util::CanHostedAppsOpenInWindows()); |
478 | 478 |
479 load_time_data.SetBoolean("canShowAppInfoDialog", | 479 load_time_data.SetBoolean("canShowAppInfoDialog", |
480 CanShowAppInfoDialog()); | 480 CanShowAppInfoDialog()); |
481 | 481 |
482 NewTabPageHandler::GetLocalizedValues(profile_, &load_time_data); | 482 AppLauncherHandler::GetLocalizedValues(profile_, &load_time_data); |
483 AppLauncherLoginHandler::GetLocalizedValues(profile_, &load_time_data); | 483 AppLauncherLoginHandler::GetLocalizedValues(profile_, &load_time_data); |
484 | 484 |
485 webui::SetLoadTimeDataDefaults(app_locale, &load_time_data); | 485 webui::SetLoadTimeDataDefaults(app_locale, &load_time_data); |
486 | 486 |
487 // Control fade and resize animations. | 487 // Control fade and resize animations. |
488 load_time_data.SetBoolean("anim", | 488 load_time_data.SetBoolean("anim", |
489 gfx::Animation::ShouldRenderRichAnimation()); | 489 gfx::Animation::ShouldRenderRichAnimation()); |
490 | 490 |
491 load_time_data.SetBoolean( | 491 load_time_data.SetBoolean( |
492 "isUserSignedIn", | 492 "isUserSignedIn", |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 // Get our template. | 604 // Get our template. |
605 static const base::StringPiece new_tab_theme_css( | 605 static const base::StringPiece new_tab_theme_css( |
606 ResourceBundle::GetSharedInstance().GetRawDataResource( | 606 ResourceBundle::GetSharedInstance().GetRawDataResource( |
607 IDR_NEW_TAB_4_THEME_CSS)); | 607 IDR_NEW_TAB_4_THEME_CSS)); |
608 | 608 |
609 // Create the string from our template and the replacements. | 609 // Create the string from our template and the replacements. |
610 std::string css_string = | 610 std::string css_string = |
611 ui::ReplaceTemplateExpressions(new_tab_theme_css, substitutions); | 611 ui::ReplaceTemplateExpressions(new_tab_theme_css, substitutions); |
612 new_tab_css_ = base::RefCountedString::TakeString(&css_string); | 612 new_tab_css_ = base::RefCountedString::TakeString(&css_string); |
613 } | 613 } |
OLD | NEW |