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();
       }
     }
   }