Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Issue 2284573004: Don't allow navigations in inactive windows to change window focus. (Closed)

Created:
4 years, 3 months ago by erikchen
Modified:
4 years, 3 months ago
Reviewers:
sky
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix a bug where inactive windows would inappropriately take focus. On Windows, it's not possible to focus a widget without activating the window. As a result, the semantics for RenderWidgetHostView::Focus include window activation on all platforms. The previous implementation for UpdateUIForNavigationInTab would focus the web contents, even if the window is backgrounded. This would activate the window. This manifested itself most clearly during session restore for two windows, when activation would bounce between the two windows, sometimes as many as 10 times!. The new implementation only focuses the contents if the window is activated, or about to be activated. If the window is backgrounded, then the appropriate content will be focused when the user chooses the activate the window. BUG=634248 Committed: https://crrev.com/0de48e14a7008fa85d9d74439a7dd63b413abb13 Cr-Commit-Position: refs/heads/master@{#415472}

Patch Set 1 #

Patch Set 2 : Fix tests on Mac. #

Patch Set 3 : Take into account the window action. #

Patch Set 4 : Missing includes. #

Patch Set 5 : Fix tests. #

Patch Set 6 : Add more comments. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+24 lines, -7 lines) Patch
M chrome/browser/ui/browser.h View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/ui/browser.cc View 1 2 2 chunks +8 lines, -4 lines 0 comments Download
M chrome/browser/ui/browser_navigator.cc View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/test/base/web_ui_browser_test.cc View 1 2 3 4 5 1 chunk +11 lines, -0 lines 2 comments Download

Messages

Total messages: 30 (23 generated)
erikchen
sky: Please review.
4 years, 3 months ago (2016-08-30 20:59:07 UTC) #22
sky
https://codereview.chromium.org/2284573004/diff/100001/chrome/test/base/web_ui_browser_test.cc File chrome/test/base/web_ui_browser_test.cc (right): https://codereview.chromium.org/2284573004/diff/100001/chrome/test/base/web_ui_browser_test.cc#newcode230 chrome/test/base/web_ui_browser_test.cc:230: // widget cannot be focused without window activation. browser_tests ...
4 years, 3 months ago (2016-08-30 22:09:07 UTC) #23
erikchen
https://codereview.chromium.org/2284573004/diff/100001/chrome/test/base/web_ui_browser_test.cc File chrome/test/base/web_ui_browser_test.cc (right): https://codereview.chromium.org/2284573004/diff/100001/chrome/test/base/web_ui_browser_test.cc#newcode230 chrome/test/base/web_ui_browser_test.cc:230: // widget cannot be focused without window activation. browser_tests ...
4 years, 3 months ago (2016-08-30 22:17:12 UTC) #24
sky
LGTM
4 years, 3 months ago (2016-08-30 22:39:48 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2284573004/100001
4 years, 3 months ago (2016-08-30 22:40:36 UTC) #27
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 3 months ago (2016-08-30 22:46:55 UTC) #28
commit-bot: I haz the power
4 years, 3 months ago (2016-08-30 22:49:32 UTC) #30
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/0de48e14a7008fa85d9d74439a7dd63b413abb13
Cr-Commit-Position: refs/heads/master@{#415472}

Powered by Google App Engine
This is Rietveld 408576698