| 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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 (alignment & ThemeService::ALIGN_RIGHT) ? "right" : ""); | 414 (alignment & ThemeService::ALIGN_RIGHT) ? "right" : ""); |
| 415 | 415 |
| 416 // Disable the promo if this is the first run, otherwise set the promo string | 416 // Disable the promo if this is the first run, otherwise set the promo string |
| 417 // for display if there is a valid outstanding promo. | 417 // for display if there is a valid outstanding promo. |
| 418 if (first_run::IsChromeFirstRun()) { | 418 if (first_run::IsChromeFirstRun()) { |
| 419 NotificationPromo::HandleClosed(profile_, | 419 NotificationPromo::HandleClosed(profile_, |
| 420 NotificationPromo::NTP_NOTIFICATION_PROMO); | 420 NotificationPromo::NTP_NOTIFICATION_PROMO); |
| 421 } else { | 421 } else { |
| 422 NotificationPromo notification_promo(profile_); | 422 NotificationPromo notification_promo(profile_); |
| 423 notification_promo.InitFromPrefs(NotificationPromo::NTP_NOTIFICATION_PROMO); | 423 notification_promo.InitFromPrefs(NotificationPromo::NTP_NOTIFICATION_PROMO); |
| 424 if (notification_promo.CanShow()) | 424 if (notification_promo.CanShow()) { |
| 425 load_time_data.SetString("serverpromo", notification_promo.promo_text()); | 425 load_time_data.SetString("notificationPromoText", |
| 426 notification_promo.promo_text()); |
| 427 } |
| 428 |
| 429 NotificationPromo bubble_promo(profile_); |
| 430 bubble_promo.InitFromPrefs(NotificationPromo::NTP_BUBBLE_PROMO); |
| 431 if (bubble_promo.CanShow()) { |
| 432 load_time_data.SetString("bubblePromoText", |
| 433 bubble_promo.promo_text()); |
| 434 } |
| 426 } | 435 } |
| 427 | 436 |
| 428 // Determine whether to show the menu for accessing tabs on other devices. | 437 // Determine whether to show the menu for accessing tabs on other devices. |
| 429 bool show_other_sessions_menu = !CommandLine::ForCurrentProcess()->HasSwitch( | 438 bool show_other_sessions_menu = !CommandLine::ForCurrentProcess()->HasSwitch( |
| 430 switches::kDisableNTPOtherSessionsMenu); | 439 switches::kDisableNTPOtherSessionsMenu); |
| 431 load_time_data.SetBoolean("showOtherSessionsMenu", | 440 load_time_data.SetBoolean("showOtherSessionsMenu", |
| 432 show_other_sessions_menu); | 441 show_other_sessions_menu); |
| 433 load_time_data.SetBoolean("isUserSignedIn", | 442 load_time_data.SetBoolean("isUserSignedIn", |
| 434 !prefs->GetString(prefs::kGoogleServicesUsername).empty()); | 443 !prefs->GetString(prefs::kGoogleServicesUsername).empty()); |
| 435 | 444 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 ResourceBundle::GetSharedInstance().GetRawDataResource( | 574 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 566 chrome::search::IsInstantExtendedAPIEnabled(profile_) ? | 575 chrome::search::IsInstantExtendedAPIEnabled(profile_) ? |
| 567 IDR_NEW_TAB_SEARCH_THEME_CSS : IDR_NEW_TAB_4_THEME_CSS, | 576 IDR_NEW_TAB_SEARCH_THEME_CSS : IDR_NEW_TAB_4_THEME_CSS, |
| 568 ui::SCALE_FACTOR_NONE)); | 577 ui::SCALE_FACTOR_NONE)); |
| 569 | 578 |
| 570 // Create the string from our template and the replacements. | 579 // Create the string from our template and the replacements. |
| 571 std::string css_string; | 580 std::string css_string; |
| 572 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); | 581 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); |
| 573 new_tab_css_ = base::RefCountedString::TakeString(&css_string); | 582 new_tab_css_ = base::RefCountedString::TakeString(&css_string); |
| 574 } | 583 } |
| OLD | NEW |