diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-15 01:14:15 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-15 01:14:15 +0000 |
commit | bbf8a1c1044f290dea937d6fb53170fbbba0f899 (patch) | |
tree | 14d6023917dec6f6560fd737f97c0d723115c0b9 | |
parent | 8083cc31cb71654db903703a7ee7c56d7df8f6ae (diff) | |
download | chromium_src-bbf8a1c1044f290dea937d6fb53170fbbba0f899.zip chromium_src-bbf8a1c1044f290dea937d6fb53170fbbba0f899.tar.gz chromium_src-bbf8a1c1044f290dea937d6fb53170fbbba0f899.tar.bz2 |
Set aura window focus in NativeWidgetAura::ClearNativeFocus only if the focus is owned by child window.
This was causing a focus to be stolen when non active window calls ClearNativeFocus.
BUG=114477
TEST=OmniboxViewTest.PopupAccelerators passes with this change
Review URL: http://codereview.chromium.org/8931022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114561 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/ui/omnibox/omnibox_view_browsertest.cc | 2 | ||||
-rw-r--r-- | ui/views/widget/native_widget_aura.cc | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc b/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc index 22f104b..6f2ecf1 100644 --- a/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc +++ b/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc @@ -1131,7 +1131,7 @@ IN_PROC_BROWSER_TEST_F(OmniboxViewTest, FLAKY_BrowserAccelerators) { } // Flakily fails and times out on Win only. http://crbug.com/69941 -#if defined(OS_WIN) || defined(USE_AURA) +#if defined(OS_WIN) #define MAYBE_PopupAccelerators DISABLED_PopupAccelerators #else #define MAYBE_PopupAccelerators PopupAccelerators diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc index 931eca5..7d5629a 100644 --- a/ui/views/widget/native_widget_aura.cc +++ b/ui/views/widget/native_widget_aura.cc @@ -528,8 +528,10 @@ void NativeWidgetAura::SetCursor(gfx::NativeCursor cursor) { } void NativeWidgetAura::ClearNativeFocus() { - if (window_ && window_->GetFocusManager()) + if (window_ && window_->GetFocusManager() && + window_->Contains(window_->GetFocusManager()->GetFocusedWindow())) { window_->GetFocusManager()->SetFocusedWindow(window_); + } } void NativeWidgetAura::FocusNativeView(gfx::NativeView native_view) { |