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

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

Issue 873503006: Handle --kiosk correctly when the browser is set to "Continue where I left off". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | 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 c8a0f2d592606e0ce5d775aab3740de4b77a5948..355fbe3876506bc5b300128042bfabd6767b1aee 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
@@ -382,6 +382,18 @@ bool StartupBrowserCreatorImpl::Launch(Profile* profile,
#endif
}
+ // In kiosk mode, we want to always be fullscreen, so switch to that now.
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode) ||
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kStartFullscreen)) {
+ // It's possible for there to be no browser window, e.g. if someone
+ // specified a non-sensical combination of options
+ // ("--kiosk --no_startup_window"); do nothing in that case.
+ Browser* browser = BrowserList::GetInstance(desktop_type)->GetLastActive();
+ if (browser)
+ chrome::ToggleFullscreenMode(browser);
+ }
+
#if defined(OS_WIN)
if (process_startup)
ShellIntegration::MigrateChromiumShortcuts();
@@ -801,12 +813,6 @@ Browser* StartupBrowserCreatorImpl::OpenTabsInBrowser(
if (!browser_creator_ || browser_creator_->show_main_browser_window())
browser->window()->Show();
- // In kiosk mode, we want to always be fullscreen, so switch to that now.
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode) ||
- base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kStartFullscreen))
- chrome::ToggleFullscreenMode(browser);
-
return browser;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698