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

Unified Diff: chrome/browser/ui/startup/startup_browser_creator_impl.cc

Issue 292713003: Session restore shouldn't care about profile home pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more fixes Created 6 years, 7 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
Index: chrome/browser/ui/startup/startup_browser_creator_impl.cc
diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
index 9ea079f53d99aac2954565d3968c24ca1fd45c72..3707b2dee89de2272f9cf48ef9aef0933e9945df 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
@@ -248,12 +248,6 @@ void RecordAppLaunches(Profile* profile,
}
}
-bool IsNewTabURL(Profile* profile, const GURL& url) {
- GURL ntp_url(chrome::kChromeUINewTabURL);
- return url == ntp_url ||
- (url.is_empty() && profile->GetHomePage() == ntp_url);
-}
-
class WebContentsCloseObserver : public content::NotificationObserver {
public:
WebContentsCloseObserver() : contents_(NULL) {}
@@ -890,14 +884,7 @@ void StartupBrowserCreatorImpl::AddStartupURLs(
std::vector<GURL>::iterator it =
browser_creator_->first_run_tabs_.begin();
while (it != browser_creator_->first_run_tabs_.end()) {
- // Replace magic names for the actual urls.
- if (it->host() == "new_tab_page") {
sky 2014/05/20 17:30:54 Are you sure we aren't actually using these names
cpu_(ooo_6.6-7.5) 2014/05/20 18:35:38 They where at some point at least. They will be in
robertshield 2014/05/20 19:36:26 What Carlos said: these magic values are used by d
- startup_urls->push_back(GURL(chrome::kChromeUINewTabURL));
- } else if (it->host() == "welcome_page") {
- startup_urls->push_back(internals::GetWelcomePageURL());
- } else {
- startup_urls->push_back(*it);
- }
+ startup_urls->push_back(*it);
++it;
}
browser_creator_->first_run_tabs_.clear();
@@ -933,7 +920,8 @@ void StartupBrowserCreatorImpl::AddStartupURLs(
// If the first URL is the NTP, replace it with the sync promo. This
// behavior is desired because completing or skipping the sync promo
// causes a redirect to the NTP.
- if (!startup_urls->empty() && IsNewTabURL(profile_, startup_urls->at(0)))
+ if (!startup_urls->empty() &&
+ startup_urls->at(0) == GURL(chrome::kChromeUINewTabURL))
startup_urls->at(0) = sync_promo_url;
else
startup_urls->insert(startup_urls->begin(), sync_promo_url);

Powered by Google App Engine
This is Rietveld 408576698