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

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

Issue 10911222: Chrome OS should open to empty desktop when session restore is empty. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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
« chrome/browser/defaults.h ('K') | « chrome/browser/defaults.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 eff808d0b5a33931c12028eaa245e66896727e41..078011129b9c9eb1f7f3b266b4c2650e4ef00e68 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
@@ -341,8 +341,7 @@ bool StartupBrowserCreatorImpl::Launch(Profile* profile,
// Special case is when app switches are passed but we do want to restore
// session. In that case open app window + focus it after session is restored.
content::WebContents* app_contents = NULL;
- if (OpenApplicationWindow(profile, &app_contents) &&
- !browser_defaults::kAppRestoreSession) {
+ if (OpenApplicationWindow(profile, &app_contents)) {
RecordLaunchModeHistogram(LM_AS_WEBAPP);
} else {
RecordLaunchModeHistogram(urls_to_open.empty() ?
@@ -352,23 +351,12 @@ bool StartupBrowserCreatorImpl::Launch(Profile* profile,
// affecting browser startup have been detected.
CheckPreferencesBackup(profile);
- // Watch for |app_contents| closing since ProcessLaunchURLs might run a
- // synchronous session restore which has a nested message loop and could
- // close |app_contents|.
- WebContentsCloseObserver app_contents_observer;
- if (browser_defaults::kAppRestoreSession && app_contents)
- app_contents_observer.SetContents(app_contents);
-
ProcessLaunchURLs(process_startup, urls_to_open);
// If this is an app launch, but we didn't open an app window, it may
// be an app tab.
OpenApplicationTab(profile);
- // In case of app mode + session restore we want to focus that app.
- if (app_contents_observer.contents())
- app_contents_observer.contents()->GetView()->SetInitialFocus();
-
if (process_startup) {
if (browser_defaults::kOSSupportsOtherBrowsers &&
!command_line_.HasSwitch(switches::kNoDefaultBrowserCheck)) {
@@ -615,8 +603,9 @@ bool StartupBrowserCreatorImpl::ProcessStartupURLs(
return false;
}
- uint32 restore_behavior = SessionRestore::SYNCHRONOUS |
- SessionRestore::ALWAYS_CREATE_TABBED_BROWSER;
+ uint32 restore_behavior = SessionRestore::SYNCHRONOUS;
+ if (browser_defaults::kAlwaysCreateTabbedBrowserOnStartup)
+ restore_behavior |= SessionRestore::ALWAYS_CREATE_TABBED_BROWSER;
#if defined(OS_MACOSX)
// On Mac, when restoring a session with no windows, suppress the creation
// of a new window in the case where the system is launching Chrome via a
« chrome/browser/defaults.h ('K') | « chrome/browser/defaults.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698