| 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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 // On Mac OS X 10.7+, horizontal scrolling can be treated as a back or | 470 // On Mac OS X 10.7+, horizontal scrolling can be treated as a back or |
| 471 // forward gesture. Pass through a flag that indicates whether or not that | 471 // forward gesture. Pass through a flag that indicates whether or not that |
| 472 // feature is enabled. | 472 // feature is enabled. |
| 473 load_time_data.SetBoolean("isSwipeTrackingFromScrollEventsEnabled", | 473 load_time_data.SetBoolean("isSwipeTrackingFromScrollEventsEnabled", |
| 474 is_swipe_tracking_from_scroll_events_enabled_); | 474 is_swipe_tracking_from_scroll_events_enabled_); |
| 475 | 475 |
| 476 load_time_data.SetBoolean("showApps", should_show_apps_page_); | 476 load_time_data.SetBoolean("showApps", should_show_apps_page_); |
| 477 load_time_data.SetBoolean("showWebStoreIcon", | 477 load_time_data.SetBoolean("showWebStoreIcon", |
| 478 !prefs->GetBoolean(prefs::kHideWebStoreIcon)); | 478 !prefs->GetBoolean(prefs::kHideWebStoreIcon)); |
| 479 | 479 |
| 480 bool bookmark_apps_enabled = extensions::util::IsNewBookmarkAppsEnabled(); | 480 load_time_data.SetBoolean("enableNewBookmarkApps", |
| 481 load_time_data.SetBoolean("enableNewBookmarkApps", bookmark_apps_enabled); | 481 extensions::util::IsNewBookmarkAppsEnabled()); |
| 482 |
| 483 load_time_data.SetBoolean("canHostedAppsOpenInWindows", |
| 484 extensions::util::CanHostedAppsOpenInWindows()); |
| 482 | 485 |
| 483 load_time_data.SetBoolean("canShowAppInfoDialog", | 486 load_time_data.SetBoolean("canShowAppInfoDialog", |
| 484 CanShowAppInfoDialog()); | 487 CanShowAppInfoDialog()); |
| 485 | 488 |
| 486 #if defined(OS_CHROMEOS) | 489 #if defined(OS_CHROMEOS) |
| 487 load_time_data.SetString("expandMenu", | 490 load_time_data.SetString("expandMenu", |
| 488 l10n_util::GetStringUTF16(IDS_NEW_TAB_CLOSE_MENU_EXPAND)); | 491 l10n_util::GetStringUTF16(IDS_NEW_TAB_CLOSE_MENU_EXPAND)); |
| 489 #endif | 492 #endif |
| 490 | 493 |
| 491 NewTabPageHandler::GetLocalizedValues(profile_, &load_time_data); | 494 NewTabPageHandler::GetLocalizedValues(profile_, &load_time_data); |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 // Get our template. | 656 // Get our template. |
| 654 static const base::StringPiece new_tab_theme_css( | 657 static const base::StringPiece new_tab_theme_css( |
| 655 ResourceBundle::GetSharedInstance().GetRawDataResource( | 658 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 656 IDR_NEW_TAB_4_THEME_CSS)); | 659 IDR_NEW_TAB_4_THEME_CSS)); |
| 657 | 660 |
| 658 // Create the string from our template and the replacements. | 661 // Create the string from our template and the replacements. |
| 659 std::string css_string = | 662 std::string css_string = |
| 660 ui::ReplaceTemplateExpressions(new_tab_theme_css, substitutions); | 663 ui::ReplaceTemplateExpressions(new_tab_theme_css, substitutions); |
| 661 new_tab_css_ = base::RefCountedString::TakeString(&css_string); | 664 new_tab_css_ = base::RefCountedString::TakeString(&css_string); |
| 662 } | 665 } |
| OLD | NEW |