Commit b1c225fa authored by jennb@chromium.org's avatar jennb@chromium.org

Fix Linux panels to return to fully minimized mode after mouse moves away.

Regression came from change to leave panel in title-only mode
when draw attention is cleared, but mouse is over the panel title. (r137530)

BUG=None
TEST=Updated StopDrawingAttentionWhileMinimized and DragMinimizedPanelWhileDrawingAttention


Review URL: https://chromiumcodereview.appspot.com/10828220

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151190 0039d316-1c4b-4281-b951-d872f2087c98
parent fa212fe2
......@@ -585,6 +585,9 @@ bool DockedPanelStrip::ShouldBringUpTitlebars(int mouse_x, int mouse_y) const {
}
void DockedPanelStrip::BringUpOrDownTitlebars(bool bring_up) {
if (are_titlebars_up_ == bring_up)
return;
are_titlebars_up_ = bring_up;
int task_delay_ms = 0;
......
......@@ -1043,7 +1043,14 @@ IN_PROC_BROWSER_TEST_F(OldPanelBrowserTest,
EXPECT_EQ(Panel::TITLE_ONLY, panel1->expansion_state());
EXPECT_EQ(Panel::MINIMIZED, panel2->expansion_state());
// Move mouse away and panel should go back to fully minimized state.
// Typical user scenario will detect the mouse in the panel
// after attention is cleared, causing titles to pop up, so
// we simulate that here.
MoveMouseAndWaitForExpansionStateChange(panel2, hover_point_in_panel);
EXPECT_EQ(Panel::TITLE_ONLY, panel1->expansion_state());
EXPECT_EQ(Panel::TITLE_ONLY, panel2->expansion_state());
// Move mouse away and panels should go back to fully minimized state.
MoveMouseAndWaitForExpansionStateChange(panel1, hover_point);
EXPECT_EQ(Panel::MINIMIZED, panel1->expansion_state());
EXPECT_EQ(Panel::MINIMIZED, panel2->expansion_state());
......
......@@ -471,6 +471,11 @@ IN_PROC_BROWSER_TEST_F(OldPanelDragBrowserTest,
EXPECT_FALSE(panel->IsDrawingAttention());
EXPECT_EQ(Panel::TITLE_ONLY, panel->expansion_state());
// Typical user scenario will detect the mouse in the panel
// after attention is cleared, causing titles to pop up, so
// we simulate that here.
MoveMouse(mouse_location);
// Verify panel returns to fully minimized state after dragging ends once
// mouse moves away from the panel.
panel_testing->FinishDragTitlebar();
......
......@@ -1132,7 +1132,14 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest, StopDrawingAttentionWhileMinimized) {
EXPECT_EQ(Panel::TITLE_ONLY, panel1->expansion_state());
EXPECT_EQ(Panel::MINIMIZED, panel2->expansion_state());
// Move mouse away and panel should go back to fully minimized state.
// Typical user scenario will detect the mouse in the panel
// after attention is cleared, causing titles to pop up, so
// we simulate that here.
MoveMouseAndWaitForExpansionStateChange(panel2, hover_point_in_panel);
EXPECT_EQ(Panel::TITLE_ONLY, panel1->expansion_state());
EXPECT_EQ(Panel::TITLE_ONLY, panel2->expansion_state());
// Move mouse away and panels should go back to fully minimized state.
MoveMouseAndWaitForExpansionStateChange(panel1, hover_point);
EXPECT_EQ(Panel::MINIMIZED, panel1->expansion_state());
EXPECT_EQ(Panel::MINIMIZED, panel2->expansion_state());
......
......@@ -474,6 +474,11 @@ IN_PROC_BROWSER_TEST_F(PanelDragBrowserTest,
EXPECT_FALSE(panel->IsDrawingAttention());
EXPECT_EQ(Panel::TITLE_ONLY, panel->expansion_state());
// Typical user scenario will detect the mouse in the panel
// after attention is cleared, causing titles to pop up, so
// we simulate that here.
MoveMouse(mouse_location);
// Verify panel returns to fully minimized state after dragging ends once
// mouse moves away from the panel.
panel_testing->FinishDragTitlebar();
......
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