Commit fff70a41 authored by Jun Mukai's avatar Jun Mukai Committed by Commit Bot

synchronize visibility of hosted_app_buttons with caption buttons

The hosted_app_buttons should be invisible when the caption buttons
(i.e. maximize/minimize/close buttons) are invisible.

Bug: 951068
Test: browser_tests
Change-Id: Ic944b6d90c3cda4397f38f34d5de86e2a26ca070
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1560314Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Jun Mukai <mukai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#649320}
parent 674b3040
......@@ -546,8 +546,11 @@ void BrowserNonClientFrameViewAsh::OnTabletModeToggled(bool enabled) {
OnImmersiveRevealEnded();
}
caption_button_container_->SetVisible(ShouldShowCaptionButtons());
const bool should_show_caption_buttons = ShouldShowCaptionButtons();
caption_button_container_->SetVisible(should_show_caption_buttons);
caption_button_container_->UpdateCaptionButtonState(true /*=animate*/);
if (hosted_app_button_container())
hosted_app_button_container()->SetVisible(should_show_caption_buttons);
if (enabled) {
// Enter immersive mode if the feature is enabled and the widget is not
......@@ -756,7 +759,10 @@ bool BrowserNonClientFrameViewAsh::ShouldPaint() const {
}
void BrowserNonClientFrameViewAsh::OnOverviewOrSplitviewModeChanged() {
caption_button_container_->SetVisible(ShouldShowCaptionButtons());
const bool should_show_caption_buttons = ShouldShowCaptionButtons();
caption_button_container_->SetVisible(should_show_caption_buttons);
if (hosted_app_button_container())
hosted_app_button_container()->SetVisible(should_show_caption_buttons);
}
std::unique_ptr<ash::FrameHeader>
......
......@@ -936,6 +936,17 @@ IN_PROC_BROWSER_TEST_P(HostedAppNonClientFrameViewAshTest, FocusableViews) {
EXPECT_TRUE(browser_view_->contents_web_view()->HasFocus());
}
IN_PROC_BROWSER_TEST_P(HostedAppNonClientFrameViewAshTest,
ButtonVisibilityInOverviewMode) {
SetUpHostedApp();
EXPECT_TRUE(hosted_app_button_container_->visible());
ToggleOverview();
EXPECT_FALSE(hosted_app_button_container_->visible());
ToggleOverview();
EXPECT_TRUE(hosted_app_button_container_->visible());
}
// Tests that a web app's theme color is set.
IN_PROC_BROWSER_TEST_P(HostedAppNonClientFrameViewAshTest, ThemeColor) {
SetUpHostedApp();
......
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