summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorarv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-30 00:52:26 +0000
committerarv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-30 00:52:26 +0000
commit49cc504342b6b60f152d999f410e59c728925a17 (patch)
tree287fc2d3aacd4a70cf7f9f149716b66b5540e940 /chrome
parent18a0cbcb3a11d1d3b064f972007e8877a8f81636 (diff)
downloadchromium_src-49cc504342b6b60f152d999f410e59c728925a17.zip
chromium_src-49cc504342b6b60f152d999f410e59c728925a17.tar.gz
chromium_src-49cc504342b6b60f152d999f410e59c728925a17.tar.bz2
NTP: Remove command line flag that allowed a local file to be used for the new tab page.
BUG=None TEST=None Review URL: http://codereview.chromium.org/2886002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51204 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/dom_ui/ntp_resource_cache.cc38
-rw-r--r--chrome/common/chrome_switches.cc6
-rw-r--r--chrome/common/chrome_switches.h1
3 files changed, 2 insertions, 43 deletions
diff --git a/chrome/browser/dom_ui/ntp_resource_cache.cc b/chrome/browser/dom_ui/ntp_resource_cache.cc
index 8dd23b9..1a76937 100644
--- a/chrome/browser/dom_ui/ntp_resource_cache.cc
+++ b/chrome/browser/dom_ui/ntp_resource_cache.cc
@@ -64,27 +64,6 @@ std::wstring GetUrlWithLang(const char* const url) {
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,21 +306,8 @@ void NTPResourceCache::CreateNewTabHTML() {
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();
-
- 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);
- }
+ base::StringPiece 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.
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 9d16869..e77bee5 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -583,12 +583,6 @@ const char kNaClLoaderProcess[] = "nacl-loader";
// Causes the Native Client process to display a dialog on launch.
const char kNaClStartupDialog[] = "nacl-startup-dialog";
-// Allows the new tab page resource to be loaded from a local HTML file. This
-// should be a path to the HTML file that you want to use for the new tab page.
-// It is used for manually testing new versions of the new tab page only,
-// performance will be poor.
-const char kNewTabPage[] = "new-tab-page";
-
// Uses the new unified app menu instead of the old "page/app" split menus.
const char kNewWrenchMenu[] = "new-wrench-menu";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index b1aabb8..2f43e5c 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -175,7 +175,6 @@ extern const char kMetricsRecordingOnly[];
extern const char kNaClBrokerProcess[];
extern const char kNaClLoaderProcess[];
extern const char kNaClStartupDialog[];
-extern const char kNewTabPage[];
extern const char kNewWrenchMenu[];
extern const char kNoDefaultBrowserCheck[];
extern const char kNoEvents[];