Commit 96958c0a authored by estade@chromium.org's avatar estade@chromium.org

ntp: remove dead first run code

my favorite part is:

  static bool first_view = true;
  if (first_view) {
    first_view = false;
  }

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/7562019

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95517 0039d316-1c4b-4281-b951-d872f2087c98
parent 7269d642
...@@ -8271,14 +8271,6 @@ Keep your key file in a safe place. You will need it to create new versions of y ...@@ -8271,14 +8271,6 @@ Keep your key file in a safe place. You will need it to create new versions of y
desc="Tooltip text for the button that shows the menu that hides and shows different sections on the new tab page."> desc="Tooltip text for the button that shows the menu that hides and shows different sections on the new tab page.">
Change page layout Change page layout
</message> </message>
<message name="IDS_NEW_TAB_FIRST_RUN_NOTIFICATION"
desc="Notification text to show in the banner at the top of the new tab page when the user first sees it.">
Over time, the area below will show your eight most visited sites.
</message>
<message name="IDS_NEW_TAB_CLOSE_FIRST_RUN_NOTIFICATION"
desc="Action text for link that closes the first run notification.">
Close
</message>
<message name="IDS_NEW_TAB_HOME_PAGE_SET_NOTIFICATION" <message name="IDS_NEW_TAB_HOME_PAGE_SET_NOTIFICATION"
desc="Notification text to show after the user has made the NTP his/her home page."> desc="Notification text to show after the user has made the NTP his/her home page.">
Welcome to your home page! Welcome to your home page!
......
...@@ -204,14 +204,6 @@ NewTabUI::NewTabUI(TabContents* contents) ...@@ -204,14 +204,6 @@ NewTabUI::NewTabUI(TabContents* contents)
// thumbnails, but also clicks on recently bookmarked. // thumbnails, but also clicks on recently bookmarked.
link_transition_type_ = PageTransition::AUTO_BOOKMARK; link_transition_type_ = PageTransition::AUTO_BOOKMARK;
if (NewTabUI::FirstRunDisabled())
NewTabHTMLSource::set_first_run(false);
static bool first_view = true;
if (first_view) {
first_view = false;
}
if (!GetProfile()->IsOffTheRecord()) { if (!GetProfile()->IsOffTheRecord()) {
PrefService* pref_service = GetProfile()->GetPrefs(); PrefService* pref_service = GetProfile()->GetPrefs();
if (!NewTabSyncSetupHandler::ShouldShowSyncPromo()) if (!NewTabSyncSetupHandler::ShouldShowSyncPromo())
...@@ -376,12 +368,6 @@ void NewTabUI::MigrateUserPrefs(PrefService* prefs, int old_pref_version, ...@@ -376,12 +368,6 @@ void NewTabUI::MigrateUserPrefs(PrefService* prefs, int old_pref_version,
current_pref_version()); current_pref_version());
} }
// static
bool NewTabUI::FirstRunDisabled() {
const CommandLine* command_line = CommandLine::ForCurrentProcess();
return command_line->HasSwitch(switches::kDisableNewTabFirstRun);
}
// static // static
void NewTabUI::SetURLTitleAndDirection(DictionaryValue* dictionary, void NewTabUI::SetURLTitleAndDirection(DictionaryValue* dictionary,
const string16& title, const string16& title,
...@@ -435,8 +421,6 @@ void NewTabUI::SetURLTitleAndDirection(DictionaryValue* dictionary, ...@@ -435,8 +421,6 @@ void NewTabUI::SetURLTitleAndDirection(DictionaryValue* dictionary,
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// NewTabHTMLSource // NewTabHTMLSource
bool NewTabUI::NewTabHTMLSource::first_run_ = true;
NewTabUI::NewTabHTMLSource::NewTabHTMLSource(Profile* profile) NewTabUI::NewTabHTMLSource::NewTabHTMLSource(Profile* profile)
: DataSource(chrome::kChromeUINewTabHost, MessageLoop::current()), : DataSource(chrome::kChromeUINewTabHost, MessageLoop::current()),
profile_(profile) { profile_(profile) {
......
...@@ -37,10 +37,6 @@ class NewTabUI : public ChromeWebUI, ...@@ -37,10 +37,6 @@ class NewTabUI : public ChromeWebUI,
static void MigrateUserPrefs(PrefService* prefs, int old_pref_version, static void MigrateUserPrefs(PrefService* prefs, int old_pref_version,
int new_pref_version); int new_pref_version);
// Whether we should disable the first run notification based on the command
// line switch.
static bool FirstRunDisabled();
// Adds "url", "title", and "direction" keys on incoming dictionary, setting // Adds "url", "title", and "direction" keys on incoming dictionary, setting
// title as the url as a fallback on empty title. // title as the url as a fallback on empty title.
static void SetURLTitleAndDirection(base::DictionaryValue* dictionary, static void SetURLTitleAndDirection(base::DictionaryValue* dictionary,
...@@ -64,16 +60,9 @@ class NewTabUI : public ChromeWebUI, ...@@ -64,16 +60,9 @@ class NewTabUI : public ChromeWebUI,
virtual bool ShouldReplaceExistingSource() const; virtual bool ShouldReplaceExistingSource() const;
// Setters and getters for first_run.
static void set_first_run(bool first_run) { first_run_ = first_run; }
static bool first_run() { return first_run_; }
private: private:
virtual ~NewTabHTMLSource() {} virtual ~NewTabHTMLSource() {}
// Whether this is the first run.
static bool first_run_;
// Pointer back to the original profile. // Pointer back to the original profile.
Profile* profile_; Profile* profile_;
......
...@@ -324,8 +324,6 @@ void NTPResourceCache::CreateNewTabHTML() { ...@@ -324,8 +324,6 @@ void NTPResourceCache::CreateNewTabHTML() {
l10n_util::GetStringUTF16(IDS_NEW_TAB_SHOW_HIDE_LIST_TOOLTIP)); l10n_util::GetStringUTF16(IDS_NEW_TAB_SHOW_HIDE_LIST_TOOLTIP));
localized_strings.SetString("pagedisplaytooltip", localized_strings.SetString("pagedisplaytooltip",
l10n_util::GetStringUTF16(IDS_NEW_TAB_PAGE_DISPLAY_TOOLTIP)); l10n_util::GetStringUTF16(IDS_NEW_TAB_PAGE_DISPLAY_TOOLTIP));
localized_strings.SetString("closefirstrunnotification",
l10n_util::GetStringUTF16(IDS_NEW_TAB_CLOSE_FIRST_RUN_NOTIFICATION));
localized_strings.SetString("close", l10n_util::GetStringUTF16(IDS_CLOSE)); localized_strings.SetString("close", l10n_util::GetStringUTF16(IDS_CLOSE));
localized_strings.SetString("history", localized_strings.SetString("history",
l10n_util::GetStringUTF16(IDS_NEW_TAB_HISTORY)); l10n_util::GetStringUTF16(IDS_NEW_TAB_HISTORY));
......
...@@ -274,10 +274,6 @@ const char kDisableIPPooling[] = "disable-ip-pooling"; ...@@ -274,10 +274,6 @@ const char kDisableIPPooling[] = "disable-ip-pooling";
// Disable speculative TCP/IP preconnection. // Disable speculative TCP/IP preconnection.
const char kDisablePreconnect[] = "disable-preconnect"; const char kDisablePreconnect[] = "disable-preconnect";
// Whether we should prevent the new tab page from showing the first run
// notification.
const char kDisableNewTabFirstRun[] = "disable-new-tab-first-run";
// Normally when the user attempts to navigate to a page that was the result of // Normally when the user attempts to navigate to a page that was the result of
// a post we prompt to make sure they want to. This switch may be used to // a post we prompt to make sure they want to. This switch may be used to
// disable that check. This switch is used during automated testing. // disable that check. This switch is used during automated testing.
......
...@@ -84,7 +84,6 @@ extern const char kDisableInteractiveFormValidation[]; ...@@ -84,7 +84,6 @@ extern const char kDisableInteractiveFormValidation[];
extern const char kDisableInternalFlash[]; extern const char kDisableInternalFlash[];
extern const char kDisableIPv6[]; extern const char kDisableIPv6[];
extern const char kDisableIPPooling[]; extern const char kDisableIPPooling[];
extern const char kDisableNewTabFirstRun[];
extern const char kDisablePreconnect[]; extern const char kDisablePreconnect[];
extern const char kDisablePromptOnRepost[]; extern const char kDisablePromptOnRepost[];
extern const char kDisableRemoteFonts[]; extern const char kDisableRemoteFonts[];
......
...@@ -46,10 +46,6 @@ class NewTabUIStartupTest : public UIPerfTest { ...@@ -46,10 +46,6 @@ class NewTabUIStartupTest : public UIPerfTest {
// Install the location of the test profile file. // Install the location of the test profile file.
set_template_user_data(UITest::ComputeTypicalUserDataSource( set_template_user_data(UITest::ComputeTypicalUserDataSource(
profile_type)); profile_type));
// Disable the first run notification because it has an animation which
// masks any real performance regressions.
launch_arguments_.AppendSwitch(switches::kDisableNewTabFirstRun);
} }
// Run the test, by bringing up a browser and timing the new tab startup. // Run the test, by bringing up a browser and timing the new tab startup.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment