From 550a2a688863effa5053fe426d4711d6537866bc Mon Sep 17 00:00:00 2001 From: "finnur@google.com" Date: Thu, 4 Sep 2008 20:30:00 +0000 Subject: Fixing issue 1343052: a regression where the Find box moves up when you open a new tab and close it again. This is because during a TabClosingAt call, we end up calling ShowTabContents(NULL) which leads to ShelfVisibilityChangedImpl(NULL). Because the parameter current_tab is NULL, we end up removing the BookmarkBarView from the RootView (only to add it back a little too late), the Find window thinks there is no BookmarkBar and hence moves up a bit. I am also enabling the disabled UI test I wrote for this, since it should now pass. BUG=1343052 TEST=Covered by UI test. Review URL: http://codereview.chromium.org/441 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1727 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/find_in_page_controller_uitest.cc | 3 ++- chrome/browser/vista_frame.cc | 2 +- chrome/browser/xp_frame.cc | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'chrome') diff --git a/chrome/browser/find_in_page_controller_uitest.cc b/chrome/browser/find_in_page_controller_uitest.cc index 821cdfe..be0da8e 100644 --- a/chrome/browser/find_in_page_controller_uitest.cc +++ b/chrome/browser/find_in_page_controller_uitest.cc @@ -122,7 +122,7 @@ TEST_F(FindInPageControllerTest, FindEnoughMatches_Issue1341577) { // The find window should not change its location just because we open and close // a new tab. -TEST_F(FindInPageControllerTest, DISABLED_FindMovesOnTabClose_Issue1343052) { +TEST_F(FindInPageControllerTest, FindMovesOnTabClose_Issue1343052) { TestServer server(L"chrome/test/data"); GURL url = server.TestServerPageW(kFramePage); @@ -159,6 +159,7 @@ TEST_F(FindInPageControllerTest, DISABLED_FindMovesOnTabClose_Issue1343052) { // Now reset the bookmarks bar state and try the same again. browser->ApplyAccelerator(IDC_SHOW_BOOKMARKS_BAR); + Sleep(kWaitForActionMsec); // Bookmark bar has moved, reset our coordinates. EXPECT_TRUE(tabA->GetFindWindowLocation(&x, &y)); diff --git a/chrome/browser/vista_frame.cc b/chrome/browser/vista_frame.cc index c1c73ac..64bf4f8 100644 --- a/chrome/browser/vista_frame.cc +++ b/chrome/browser/vista_frame.cc @@ -1597,7 +1597,7 @@ void VistaFrame::ShelfVisibilityChangedImpl(TabContents* current_tab) { changed |= UpdateChildViewAndLayout(new_info_bar, &info_bar_view_); ChromeViews::View* new_bookmark_bar_view = NULL; - if (SupportsBookmarkBar() && current_tab) + if (SupportsBookmarkBar()) new_bookmark_bar_view = GetBookmarkBarView(); changed |= UpdateChildViewAndLayout(new_bookmark_bar_view, &active_bookmark_bar_); diff --git a/chrome/browser/xp_frame.cc b/chrome/browser/xp_frame.cc index cba5906..872acac 100644 --- a/chrome/browser/xp_frame.cc +++ b/chrome/browser/xp_frame.cc @@ -2483,7 +2483,7 @@ void XPFrame::ShelfVisibilityChangedImpl(TabContents* current_tab) { changed |= UpdateChildViewAndLayout(new_info_bar, &info_bar_view_); ChromeViews::View* new_bookmark_bar_view = NULL; - if (SupportsBookmarkBar() && current_tab) + if (SupportsBookmarkBar()) new_bookmark_bar_view = GetBookmarkBarView(); changed |= UpdateChildViewAndLayout(new_bookmark_bar_view, &active_bookmark_bar_); -- cgit v1.1