From cceef99cfabebbafb13371fc6a47dd1c875fc8b1 Mon Sep 17 00:00:00 2001 From: "willchan@chromium.org" Date: Mon, 18 May 2009 16:27:34 +0000 Subject: Linux: Fix interstitials to work across tab changes. BUG=http://www.crbug.com/8486 TEST=Bring up two tabs. In one tab, navigate to https://ianfette.org. Switch to the next tab. Switch back to the first tab. It should still display the interstitial page. Try this both with the focus on the interstitial page before you switch to the second tab and with the focus on the omnibox before switching tabs, to make sure focus is set properly. Review URL: http://codereview.chromium.org/115446 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16282 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/tab_contents/tab_contents_view_gtk.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'chrome/browser/tab_contents') diff --git a/chrome/browser/tab_contents/tab_contents_view_gtk.cc b/chrome/browser/tab_contents/tab_contents_view_gtk.cc index 0449847..1ccc202 100644 --- a/chrome/browser/tab_contents/tab_contents_view_gtk.cc +++ b/chrome/browser/tab_contents/tab_contents_view_gtk.cc @@ -17,6 +17,7 @@ #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/renderer_host/render_view_host_factory.h" #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h" +#include "chrome/browser/tab_contents/interstitial_page.h" #include "chrome/browser/tab_contents/render_view_context_menu_gtk.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/tab_contents/tab_contents_delegate.h" @@ -200,9 +201,13 @@ bool TabContentsViewGtk::GetFindBarWindowInfo(gfx::Point* position, } void TabContentsViewGtk::Focus() { - GtkWidget* widget = GetContentNativeView(); - if (widget) - gtk_widget_grab_focus(widget); + if (tab_contents()->showing_interstitial_page()) { + tab_contents()->interstitial_page()->Focus(); + } else { + GtkWidget* widget = GetContentNativeView(); + if (widget) + gtk_widget_grab_focus(widget); + } } void TabContentsViewGtk::SetInitialFocus() { -- cgit v1.1