Commit ba2ded87 authored by wjmaclean's avatar wjmaclean Committed by Commit bot

Don't hide the zoom icon when not at default zoom.

This cl reverts a change made in

https://codereview.chromium.org/952823004

Since this code is controlling the display of the zoom icon (not
the bubble) we should not hide when not at default zoom level.

BUG=462482

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

Cr-Commit-Position: refs/heads/master@{#318908}
parent a58d0f0c
......@@ -151,7 +151,7 @@ void ZoomDecoration::OnClose() {
// If the page is at default zoom then hiding the zoom decoration
// was suppressed while the bubble was open. Now that the bubble is
// closed the decoration can be hidden.
if (IsVisible()) {
if (IsAtDefaultZoom() && IsVisible()) {
SetVisible(false);
owner_->OnDecorationsChanged();
}
......
......@@ -108,6 +108,32 @@ IN_PROC_BROWSER_TEST_F(ZoomDecorationTest, BubbleAtDefaultZoom) {
EXPECT_FALSE(zoom_decoration->IsVisible());
}
// Regression test for https://crbug.com/462482.
IN_PROC_BROWSER_TEST_F(ZoomDecorationTest, IconRemainsVisibleAfterBubble) {
ZoomDecoration* zoom_decoration = GetZoomDecoration();
// See comment in BubbleAtDefaultZoom regarding this next line.
ui_zoom::ZoomController::FromWebContents(
GetLocationBar()->GetWebContents())->SetShowsNotificationBubble(false);
// Zoom in to turn on decoration icon.
EXPECT_FALSE(zoom_decoration->IsVisible());
Zoom(content::PAGE_ZOOM_IN);
EXPECT_TRUE(zoom_decoration->IsVisible());
// Show zoom bubble, verify decoration icon remains visible.
zoom_decoration->ShowBubble(/* auto_close = */false);
EXPECT_TRUE(zoom_decoration->IsVisible());
// Close bubble and verify the decoration is still visible.
zoom_decoration->CloseBubble();
EXPECT_TRUE(zoom_decoration->IsVisible());
// Verify the decoration does go away when we expect it to.
Zoom(content::PAGE_ZOOM_RESET);
EXPECT_FALSE(zoom_decoration->IsVisible());
}
IN_PROC_BROWSER_TEST_F(ZoomDecorationTest, HideOnInputProgress) {
ZoomDecoration* zoom_decoration = GetZoomDecoration();
......
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