From 89d7ac15b518146cc57a7cc8df6b73bcf36a1c19 Mon Sep 17 00:00:00 2001 From: "estade@chromium.org" Date: Mon, 18 May 2009 16:30:02 +0000 Subject: Linux: make RWHV::Focus() set native focus (in addition to webkit focus). Review URL: http://codereview.chromium.org/113528 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16283 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/renderer_host/render_widget_host_view_gtk.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'chrome/browser') diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc index ee2f7b9..c11d3af 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc @@ -234,16 +234,21 @@ void RenderWidgetHostViewGtk::MovePluginWindows( } void RenderWidgetHostViewGtk::Focus() { - host_->Focus(); + gtk_widget_grab_focus(view_.get()); } void RenderWidgetHostViewGtk::Blur() { - host_->Blur(); + // TODO(estade): We should be clearing native focus as well, but I know of no + // way to do that without focusing another widget. + // TODO(estade): it doesn't seem like the CanBlur() check should be necessary + // since we are only called in response to a ViewHost blur message, but this + // check is made on Windows so I've added it here as well. + if (host_->CanBlur()) + host_->Blur(); } bool RenderWidgetHostViewGtk::HasFocus() { - NOTIMPLEMENTED(); - return false; + return gtk_widget_is_focus(view_.get()); } void RenderWidgetHostViewGtk::Show() { -- cgit v1.1