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

Unified Diff: chrome/browser/dom_ui/ntp_resource_cache.cc

Issue 2886002: NTP: Remove command line flag that allowed a local file to be used for the ne... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/ntp_resource_cache.cc
===================================================================
--- chrome/browser/dom_ui/ntp_resource_cache.cc (revision 50775)
+++ chrome/browser/dom_ui/ntp_resource_cache.cc (working copy)
@@ -64,27 +64,6 @@
return ASCIIToWide(google_util::AppendGoogleLocaleParam(GURL(url)).spec());
}
-// In case a file path to the new tab page was provided this tries to load
-// the file and returns the file content if successful. This returns an
-// empty string in case of failure.
-std::string GetCustomNewTabPageFromCommandLine() {
- const CommandLine* command_line = CommandLine::ForCurrentProcess();
- const FilePath file_path = command_line->GetSwitchValuePath(
- switches::kNewTabPage);
-
- if (!file_path.empty()) {
- // Read the file contents in, blocking the UI thread of the browser.
- // This is for testing purposes only! It is used to test new versions of
- // the new tab page using a special command line option. Never use this
- // in a way that will be used by default in product.
- std::string file_contents;
- if (file_util::ReadFileToString(FilePath(file_path), &file_contents))
- return file_contents;
- }
-
- return std::string();
-}
-
std::string SkColorToRGBAString(SkColor color) {
// We convert the alpha using DoubleToString because StringPrintf will use
// locale specific formatters (e.g., use , instead of . in German).
@@ -327,22 +306,9 @@
prefs::kNTPShownSections);
localized_strings.SetInteger(L"shown_sections", shown_sections);
- // In case we have the new new tab page enabled we first try to read the file
- // provided on the command line. If that fails we just get the resource from
- // the resource bundle.
- base::StringPiece new_tab_html;
- std::string new_tab_html_str;
- new_tab_html_str = GetCustomNewTabPageFromCommandLine();
+ base::StringPiece new_tab_html(ResourceBundle::GetSharedInstance().
+ GetRawDataResource(IDR_NEW_NEW_TAB_HTML));
- if (!new_tab_html_str.empty()) {
- new_tab_html = base::StringPiece(new_tab_html_str);
- }
-
- if (new_tab_html.empty()) {
- new_tab_html = ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_NEW_NEW_TAB_HTML);
- }
-
// Inject the template data into the HTML so that it is available before any
// layout is needed.
std::string json_html;
« no previous file with comments | « no previous file | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698