Commit 3edc554b authored by Sidney San Martín's avatar Sidney San Martín Committed by Commit Bot

Hide the toolbar in kiosk mode.

This behavior was lost in crrev/c/1546524.

Bug: 948174
Change-Id: Ic69c18b3bd6f3d990c95eca42df83ac29bdaf947
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1548560
Commit-Queue: Sidney San Martín <sdy@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Auto-Submit: Sidney San Martín <sdy@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#646611}
parent d59b8073
......@@ -37,6 +37,14 @@ constexpr int kHostedAppMenuMargin = 7;
constexpr int kFramePaddingLeft = 75;
constexpr double kTitlePaddingWidthFraction = 0.1;
FullscreenToolbarStyle GetUserPreferredToolbarStyle(bool always_show) {
// In Kiosk mode, we don't show top Chrome UI.
if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode))
return FullscreenToolbarStyle::TOOLBAR_NONE;
return always_show ? FullscreenToolbarStyle::TOOLBAR_PRESENT
: FullscreenToolbarStyle::TOOLBAR_HIDDEN;
}
} // namespace
///////////////////////////////////////////////////////////////////////////////
......@@ -55,9 +63,8 @@ BrowserNonClientFrameViewMac::BrowserNonClientFrameViewMac(
[[FullscreenToolbarControllerViews alloc]
initWithBrowserView:browser_view]);
[fullscreen_toolbar_controller_
setToolbarStyle:*show_fullscreen_toolbar_
? FullscreenToolbarStyle::TOOLBAR_PRESENT
: FullscreenToolbarStyle::TOOLBAR_HIDDEN];
setToolbarStyle:GetUserPreferredToolbarStyle(
*show_fullscreen_toolbar_)];
}
if (browser_view->IsBrowserTypeHostedApp()) {
......@@ -184,9 +191,7 @@ void BrowserNonClientFrameViewMac::UpdateFullscreenTopUI(
needs_check_tab_fullscreen) {
new_style = FullscreenToolbarStyle::TOOLBAR_NONE;
} else {
new_style = *show_fullscreen_toolbar_
? FullscreenToolbarStyle::TOOLBAR_PRESENT
: FullscreenToolbarStyle::TOOLBAR_HIDDEN;
new_style = GetUserPreferredToolbarStyle(*show_fullscreen_toolbar_);
}
[fullscreen_toolbar_controller_ setToolbarStyle:new_style];
......
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