Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Side by Side Diff: chrome/browser/ui/webui/ntp/ntp_resource_cache.cc

Issue 599653003: Remove old template html boilerplate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bydefault
Patch Set: fix android Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/net_internals/net_internals_ui.cc ('k') | chrome/browser/ui/webui/options/options_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698