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 "apps/app_launcher.h" | 10 #include "apps/app_launcher.h" |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 DictionaryValue load_time_data; | 342 DictionaryValue load_time_data; |
343 load_time_data.SetBoolean("bookmarkbarattached", | 343 load_time_data.SetBoolean("bookmarkbarattached", |
344 prefs->GetBoolean(prefs::kShowBookmarkBar)); | 344 prefs->GetBoolean(prefs::kShowBookmarkBar)); |
345 load_time_data.SetBoolean("hasattribution", | 345 load_time_data.SetBoolean("hasattribution", |
346 ThemeServiceFactory::GetForProfile(profile_)->HasCustomImage( | 346 ThemeServiceFactory::GetForProfile(profile_)->HasCustomImage( |
347 IDR_THEME_NTP_ATTRIBUTION)); | 347 IDR_THEME_NTP_ATTRIBUTION)); |
348 load_time_data.SetBoolean("showMostvisited", should_show_most_visited_page_); | 348 load_time_data.SetBoolean("showMostvisited", should_show_most_visited_page_); |
349 std::string app_launcher_promo_group_name = | 349 std::string app_launcher_promo_group_name = |
350 base::FieldTrialList::FindFullName(apps::kLauncherPromoTrialName); | 350 base::FieldTrialList::FindFullName(apps::kLauncherPromoTrialName); |
351 bool show_app_launcher_promo = | 351 bool show_app_launcher_promo = |
352 !apps::MaybeIsAppLauncherEnabled() && | 352 !apps::IsAppLauncherEnabled() && |
353 local_state->GetBoolean(apps::prefs::kShowAppLauncherPromo) && | 353 local_state->GetBoolean(apps::prefs::kShowAppLauncherPromo) && |
354 (app_launcher_promo_group_name == apps::kShowLauncherPromoOnceGroupName || | 354 (app_launcher_promo_group_name == apps::kShowLauncherPromoOnceGroupName || |
355 app_launcher_promo_group_name == | 355 app_launcher_promo_group_name == |
356 apps::kResetShowLauncherPromoPrefGroupName); | 356 apps::kResetShowLauncherPromoPrefGroupName); |
357 load_time_data.SetBoolean("showAppLauncherPromo", show_app_launcher_promo); | 357 load_time_data.SetBoolean("showAppLauncherPromo", show_app_launcher_promo); |
358 load_time_data.SetBoolean("showRecentlyClosed", | 358 load_time_data.SetBoolean("showRecentlyClosed", |
359 should_show_recently_closed_menu_); | 359 should_show_recently_closed_menu_); |
360 load_time_data.SetString("title", | 360 load_time_data.SetString("title", |
361 l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE)); | 361 l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE)); |
362 load_time_data.SetString("mostvisited", | 362 load_time_data.SetString("mostvisited", |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 // Get our template. | 622 // Get our template. |
623 static const base::StringPiece new_tab_theme_css( | 623 static const base::StringPiece new_tab_theme_css( |
624 ResourceBundle::GetSharedInstance().GetRawDataResource( | 624 ResourceBundle::GetSharedInstance().GetRawDataResource( |
625 IDR_NEW_TAB_4_THEME_CSS)); | 625 IDR_NEW_TAB_4_THEME_CSS)); |
626 | 626 |
627 // Create the string from our template and the replacements. | 627 // Create the string from our template and the replacements. |
628 std::string css_string; | 628 std::string css_string; |
629 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); | 629 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); |
630 new_tab_css_ = base::RefCountedString::TakeString(&css_string); | 630 new_tab_css_ = base::RefCountedString::TakeString(&css_string); |
631 } | 631 } |
OLD | NEW |