Commit 5045b06a authored by tommi@chromium.org's avatar tommi@chromium.org

Revert 102216 - Fix activation problem when showing bubble view

If a bubble view was shown immediately after creating a browser window the bubble view would get a deactivate event causing it to close.

The problem was that when the browser window's page was commited it would switch focus to the location bar. This caused the bubble view to lose focus and close.

Fix was to have the browser winodw switch focus to the location bar only if it was the active window. Thus if a bubble view was shown it wouldn't switch focus.

This change also modifies InProcessBrowserTest::CreateBrowserForPopup() to show the browser window before navigating to a blank page. This fixes a problem where the browser window wouldn't become active.

BUG=95146
TEST=


Review URL: http://codereview.chromium.org/7960001

TBR=sail@chromium.org
Review URL: http://codereview.chromium.org/7988001

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102263 0039d316-1c4b-4281-b951-d872f2087c98
parent e4f2081b
...@@ -852,11 +852,6 @@ LocationBar* BrowserView::GetLocationBar() const { ...@@ -852,11 +852,6 @@ LocationBar* BrowserView::GetLocationBar() const {
} }
void BrowserView::SetFocusToLocationBar(bool select_all) { void BrowserView::SetFocusToLocationBar(bool select_all) {
// Only change focus if this is the active window otherwise we'll end
// accidentally deactivating another window.
if (!IsActive())
return;
if (UseCompactNavigationBar()) { if (UseCompactNavigationBar()) {
// If focus ever goes to the location bar, we should make sure it is shown // If focus ever goes to the location bar, we should make sure it is shown
// in compact mode. This includes all accelerators that move focus there. // in compact mode. This includes all accelerators that move focus there.
......
...@@ -246,8 +246,6 @@ Browser* InProcessBrowserTest::CreateBrowserForPopup(Profile* profile) { ...@@ -246,8 +246,6 @@ Browser* InProcessBrowserTest::CreateBrowserForPopup(Profile* profile) {
} }
void InProcessBrowserTest::AddBlankTabAndShow(Browser* browser) { void InProcessBrowserTest::AddBlankTabAndShow(Browser* browser) {
browser->window()->Show();
ui_test_utils::WindowedNotificationObserver observer( ui_test_utils::WindowedNotificationObserver observer(
content::NOTIFICATION_LOAD_STOP, content::NOTIFICATION_LOAD_STOP,
NotificationService::AllSources()); NotificationService::AllSources());
...@@ -255,7 +253,7 @@ void InProcessBrowserTest::AddBlankTabAndShow(Browser* browser) { ...@@ -255,7 +253,7 @@ void InProcessBrowserTest::AddBlankTabAndShow(Browser* browser) {
GURL(chrome::kAboutBlankURL), PageTransition::START_PAGE); GURL(chrome::kAboutBlankURL), PageTransition::START_PAGE);
observer.Wait(); observer.Wait();
browser->window()->Activate(); browser->window()->Show();
} }
#if defined(OS_POSIX) #if defined(OS_POSIX)
......
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