From 494f5c479d1c61ecfb72ec1e0af89dd8e363d395 Mon Sep 17 00:00:00 2001 From: "jcivelli@chromium.org" Date: Wed, 11 Aug 2010 06:44:38 +0000 Subject: Making window.focus() work in Chrome. A patch on the WebKit side https://bugs.webkit.org/show_bug.cgi?id=43542 ensures we get the correct notification when window.focus()/blur() is called. This CL makes the browser active/unactive in response to the focus/blur message. BUG=29643 TEST=Visit gmail. Open an IM conversation window and pop-it out. Focus the browser (so the IM window is in the back). Click on the person name in the IM section of gmail. The conversation window should be brought back to the front. Repeat but this time minimize the conversation window. Review URL: http://codereview.chromium.org/3060045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55678 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/renderer/render_widget.cc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'chrome/renderer/render_widget.cc') diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc index a5f3c0b..0ca11f1 100644 --- a/chrome/renderer/render_widget.cc +++ b/chrome/renderer/render_widget.cc @@ -628,13 +628,7 @@ void RenderWidget::show(WebNavigationPolicy) { } void RenderWidget::didFocus() { - // Prevent the widget from stealing the focus if it does not have focus - // already. We do this by explicitely setting the focus to false again. - // We only let the browser focus the renderer. - if (!has_focus_ && webwidget_) { - MessageLoop::current()->PostTask(FROM_HERE, - NewRunnableMethod(this, &RenderWidget::ClearFocus)); - } + Send(new ViewHostMsg_Focus(routing_id_)); } void RenderWidget::didBlur() { -- cgit v1.1