| 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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 bool show_other_sessions_menu = should_show_other_devices_menu_ && | 550 bool show_other_sessions_menu = should_show_other_devices_menu_ && |
| 551 !CommandLine::ForCurrentProcess()->HasSwitch( | 551 !CommandLine::ForCurrentProcess()->HasSwitch( |
| 552 switches::kDisableNTPOtherSessionsMenu); | 552 switches::kDisableNTPOtherSessionsMenu); |
| 553 load_time_data.SetBoolean("showOtherSessionsMenu", show_other_sessions_menu); | 553 load_time_data.SetBoolean("showOtherSessionsMenu", show_other_sessions_menu); |
| 554 load_time_data.SetBoolean("isUserSignedIn", | 554 load_time_data.SetBoolean("isUserSignedIn", |
| 555 !prefs->GetString(prefs::kGoogleServicesUsername).empty()); | 555 !prefs->GetString(prefs::kGoogleServicesUsername).empty()); |
| 556 | 556 |
| 557 // Load the new tab page appropriate for this build. | 557 // Load the new tab page appropriate for this build. |
| 558 base::StringPiece new_tab_html(ResourceBundle::GetSharedInstance(). | 558 base::StringPiece new_tab_html(ResourceBundle::GetSharedInstance(). |
| 559 GetRawDataResource(IDR_NEW_TAB_4_HTML)); | 559 GetRawDataResource(IDR_NEW_TAB_4_HTML)); |
| 560 webui::UseVersion2 version2; | |
| 561 std::string full_html = | 560 std::string full_html = |
| 562 webui::GetI18nTemplateHtml(new_tab_html, &load_time_data); | 561 webui::GetI18nTemplateHtml(new_tab_html, &load_time_data); |
| 563 new_tab_html_ = base::RefCountedString::TakeString(&full_html); | 562 new_tab_html_ = base::RefCountedString::TakeString(&full_html); |
| 564 } | 563 } |
| 565 | 564 |
| 566 void NTPResourceCache::CreateNewTabIncognitoCSS() { | 565 void NTPResourceCache::CreateNewTabIncognitoCSS() { |
| 567 ui::ThemeProvider* tp = ThemeServiceFactory::GetForProfile(profile_); | 566 ui::ThemeProvider* tp = ThemeServiceFactory::GetForProfile(profile_); |
| 568 DCHECK(tp); | 567 DCHECK(tp); |
| 569 | 568 |
| 570 // Get our theme colors | 569 // Get our theme colors |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 // Get our template. | 714 // Get our template. |
| 716 static const base::StringPiece new_tab_theme_css( | 715 static const base::StringPiece new_tab_theme_css( |
| 717 ResourceBundle::GetSharedInstance().GetRawDataResource( | 716 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 718 IDR_NEW_TAB_4_THEME_CSS)); | 717 IDR_NEW_TAB_4_THEME_CSS)); |
| 719 | 718 |
| 720 // Create the string from our template and the replacements. | 719 // Create the string from our template and the replacements. |
| 721 std::string css_string; | 720 std::string css_string; |
| 722 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); | 721 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); |
| 723 new_tab_css_ = base::RefCountedString::TakeString(&css_string); | 722 new_tab_css_ = base::RefCountedString::TakeString(&css_string); |
| 724 } | 723 } |
| OLD | NEW |