Commit 1468d5b3 authored by pkasting's avatar pkasting Committed by Commit bot

Handle --kiosk correctly when the browser is set to "Continue where I left off".

BUG=94843
TEST=Set startup mode to "Continue where I left off".  Relaunch with --kiosk and verify the browser goes into kiosk mode.

Review URL: https://codereview.chromium.org/873503006

Cr-Commit-Position: refs/heads/master@{#317469}
parent 47382c9c
...@@ -382,6 +382,18 @@ bool StartupBrowserCreatorImpl::Launch(Profile* profile, ...@@ -382,6 +382,18 @@ bool StartupBrowserCreatorImpl::Launch(Profile* profile,
#endif #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 defined(OS_WIN)
if (process_startup) if (process_startup)
ShellIntegration::MigrateChromiumShortcuts(); ShellIntegration::MigrateChromiumShortcuts();
...@@ -801,12 +813,6 @@ Browser* StartupBrowserCreatorImpl::OpenTabsInBrowser( ...@@ -801,12 +813,6 @@ Browser* StartupBrowserCreatorImpl::OpenTabsInBrowser(
if (!browser_creator_ || browser_creator_->show_main_browser_window()) if (!browser_creator_ || browser_creator_->show_main_browser_window())
browser->window()->Show(); 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; return browser;
} }
......
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