Commit 88de6c01 authored by oshima@chromium.org's avatar oshima@chromium.org

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
parent 9f7e241b
...@@ -782,6 +782,13 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, AcceleratorRestoring) { ...@@ -782,6 +782,13 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, AcceleratorRestoring) {
// The accelerator for Escape should be back to what it was before. // The accelerator for Escape should be back to what it was before.
EXPECT_EQ(old_target, EXPECT_EQ(old_target,
focus_manager->GetCurrentTargetForAccelerator(escape)); 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 #endif // TOOLKIT_VIEWS
......
...@@ -1166,7 +1166,8 @@ void NativeWidgetGtk::Show() { ...@@ -1166,7 +1166,8 @@ void NativeWidgetGtk::Show() {
gtk_widget_show(widget_); gtk_widget_show(widget_);
if (widget_->window) if (widget_->window)
gdk_window_raise(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() { ...@@ -1175,7 +1176,15 @@ void NativeWidgetGtk::Hide() {
gtk_widget_hide(widget_); gtk_widget_hide(widget_);
if (widget_->window) if (widget_->window)
gdk_window_lower(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.
} }
} }
......
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