commit | 28ebd5bc2acb2b87566d1af5e4c907b8761b5b17 | [log] [tgz] |
---|---|---|
author | Nasko Oskov <[email protected]> | Fri Dec 07 22:29:33 2018 |
committer | Commit Bot <[email protected]> | Fri Dec 07 22:29:33 2018 |
tree | 326c2863991fe9bf0d8010103c00fe04508b7653 | |
parent | e00c0c1d741aff254afbaef2e147e28d5560cacd [diff] [blame] |
Focus newly opened window when noopener is specified. When r601148 was committed, the codepath for window.open() and link clicks that result in a new window with 'noopener' attribute was changed to avoid going to the embedder with OpenURL. The result was that the newly created window was no longer focused, which was done previously as a side effect of OpenURL calling chrome::Navigate. This CL adds focusing in the changed codepath to restore this behavior. Bug: 912348, 912712 Change-Id: Ia4f5b58a71cbe86bc28b434c0b0501b156c64bc1 Reviewed-on: https://chromium-review.googlesource.com/c/1367164 Reviewed-by: Aaron Leventhal <[email protected]> Reviewed-by: Alex Moshchuk <[email protected]> Commit-Queue: Nasko Oskov <[email protected]> Cr-Commit-Position: refs/heads/master@{#614847}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index ab9d125..ef41fbd 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2811,6 +2811,8 @@ new_contents_impl->delayed_load_url_params_ = std::move(load_params); } else { new_contents_impl->controller_.LoadURLWithParams(*load_params.get()); + if (!is_guest) + new_contents_impl->Focus(); } } }