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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 NotificationPromo bubble_promo; | 544 NotificationPromo bubble_promo; |
545 bubble_promo.InitFromPrefs(NotificationPromo::NTP_BUBBLE_PROMO); | 545 bubble_promo.InitFromPrefs(NotificationPromo::NTP_BUBBLE_PROMO); |
546 if (bubble_promo.CanShow()) { | 546 if (bubble_promo.CanShow()) { |
547 load_time_data.SetString("bubblePromoText", | 547 load_time_data.SetString("bubblePromoText", |
548 bubble_promo.promo_text()); | 548 bubble_promo.promo_text()); |
549 DVLOG(1) << "Bubble promo:" << bubble_promo.promo_text(); | 549 DVLOG(1) << "Bubble promo:" << bubble_promo.promo_text(); |
550 } | 550 } |
551 } | 551 } |
552 | 552 |
553 // Determine whether to show the menu for accessing tabs on other devices. | 553 // Determine whether to show the menu for accessing tabs on other devices. |
554 bool show_other_sessions_menu = should_show_other_devices_menu_ && | 554 bool show_other_sessions_menu = |
555 !CommandLine::ForCurrentProcess()->HasSwitch( | 555 should_show_other_devices_menu_ && |
| 556 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
556 switches::kDisableNTPOtherSessionsMenu); | 557 switches::kDisableNTPOtherSessionsMenu); |
557 load_time_data.SetBoolean("showOtherSessionsMenu", show_other_sessions_menu); | 558 load_time_data.SetBoolean("showOtherSessionsMenu", show_other_sessions_menu); |
558 load_time_data.SetBoolean( | 559 load_time_data.SetBoolean( |
559 "isUserSignedIn", | 560 "isUserSignedIn", |
560 SigninManagerFactory::GetForProfile(profile_)->IsAuthenticated()); | 561 SigninManagerFactory::GetForProfile(profile_)->IsAuthenticated()); |
561 | 562 |
562 // Load the new tab page appropriate for this build. | 563 // Load the new tab page appropriate for this build. |
563 base::StringPiece new_tab_html(ResourceBundle::GetSharedInstance(). | 564 base::StringPiece new_tab_html(ResourceBundle::GetSharedInstance(). |
564 GetRawDataResource(IDR_NEW_TAB_4_HTML)); | 565 GetRawDataResource(IDR_NEW_TAB_4_HTML)); |
565 std::string full_html = | 566 std::string full_html = |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 // Get our template. | 720 // Get our template. |
720 static const base::StringPiece new_tab_theme_css( | 721 static const base::StringPiece new_tab_theme_css( |
721 ResourceBundle::GetSharedInstance().GetRawDataResource( | 722 ResourceBundle::GetSharedInstance().GetRawDataResource( |
722 IDR_NEW_TAB_4_THEME_CSS)); | 723 IDR_NEW_TAB_4_THEME_CSS)); |
723 | 724 |
724 // Create the string from our template and the replacements. | 725 // Create the string from our template and the replacements. |
725 std::string css_string; | 726 std::string css_string; |
726 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); | 727 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); |
727 new_tab_css_ = base::RefCountedString::TakeString(&css_string); | 728 new_tab_css_ = base::RefCountedString::TakeString(&css_string); |
728 } | 729 } |
OLD | NEW |