summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-22 03:19:52 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-22 03:19:52 +0000
commit88de6c013ddad04c6896f10714c787ce21cf858a (patch)
tree58afe864c5335bbf7ead61f8082fb70b5c9dbfe6
parent9f7e241b3649c863e353c724d1117b3f56e5f512 (diff)
downloadchromium_src-88de6c013ddad04c6896f10714c787ce21cf858a.zip
chromium_src-88de6c013ddad04c6896f10714c787ce21cf858a.tar.gz
chromium_src-88de6c013ddad04c6896f10714c787ce21cf858a.tar.bz2
Don't call OnNativeWidgetVisibilityChange in NativeWidgetGtk
BUG=chromium-os:20545 TEST=added a test case in FindInPageControllerTest.AcceleratorRestoring. See bug for repro step. Review URL: http://codereview.chromium.org/7978015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102233 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/find_bar/find_bar_host_browsertest.cc7
-rw-r--r--views/widget/native_widget_gtk.cc13
2 files changed, 18 insertions, 2 deletions
diff --git a/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc b/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc
index f569772..650951c 100644
--- a/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc
+++ b/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc
@@ -782,6 +782,13 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, AcceleratorRestoring) {
// The accelerator for Escape should be back to what it was before.
EXPECT_EQ(old_target,
focus_manager->GetCurrentTargetForAccelerator(escape));
+
+ // Show find bar again with animation on, and the target should be
+ // on find bar.
+ DropdownBarHost::disable_animations_during_testing_ = false;
+ browser()->ShowFindBar();
+ EXPECT_EQ(new_target,
+ focus_manager->GetCurrentTargetForAccelerator(escape));
}
#endif // TOOLKIT_VIEWS
diff --git a/views/widget/native_widget_gtk.cc b/views/widget/native_widget_gtk.cc
index 6890c9c..b6a2280 100644
--- a/views/widget/native_widget_gtk.cc
+++ b/views/widget/native_widget_gtk.cc
@@ -1166,7 +1166,8 @@ void NativeWidgetGtk::Show() {
gtk_widget_show(widget_);
if (widget_->window)
gdk_window_raise(widget_->window);
- delegate_->OnNativeWidgetVisibilityChanged(true);
+ // See Hide() for the reason why we're not calling
+ // OnNativeWidgetVisibilityChange.
}
}
@@ -1175,7 +1176,15 @@ void NativeWidgetGtk::Hide() {
gtk_widget_hide(widget_);
if (widget_->window)
gdk_window_lower(widget_->window);
- delegate_->OnNativeWidgetVisibilityChanged(false);
+ // We're not calling OnNativeWidgetVisibilityChanged because it
+ // breaks the ability to refocus to FindBar. NativeControlGtk
+ // detaches the underlying gtk widget for optimization purpose
+ // when it becomes invisible, which in turn breaks SetNativeFocus
+ // because there is no gtk attached to NativeControlGtk. I'm not
+ // fixing that part because
+ // a) This is views/gtk only issue, which will be gone soon.
+ // b) Alternative fix, which we can modify animator to show it
+ // immediately, won't be necessary for non gtk implementation.
}
}