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

Unified Diff: headless/lib/browser/headless_web_contents_impl.cc

Issue 2709433002: Add HeadlessFocusClient to fix document.hasFocus() issues. (Closed)
Patch Set: Remove unnecessary imports Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « headless/lib/browser/headless_focus_client.cc ('k') | headless/lib/headless_web_contents_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/lib/browser/headless_web_contents_impl.cc
diff --git a/headless/lib/browser/headless_web_contents_impl.cc b/headless/lib/browser/headless_web_contents_impl.cc
index 9d4b7add3323b2db989e49f990c62d79346bf0ae..710fc84c4c9fe3849bf3da7f42ed82419ba44d11 100644
--- a/headless/lib/browser/headless_web_contents_impl.cc
+++ b/headless/lib/browser/headless_web_contents_impl.cc
@@ -21,6 +21,7 @@
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
+#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/common/bindings_policy.h"
@@ -97,6 +98,10 @@ class HeadlessWebContentsImpl::Delegate : public content::WebContentsDelegate {
security_style_explanations);
}
+ void ActivateContents(content::WebContents* contents) override {
+ contents->GetRenderViewHost()->GetWidget()->Focus();
+ }
+
private:
HeadlessBrowserContextImpl* browser_context_; // Not owned.
DISALLOW_COPY_AND_ASSIGN(Delegate);
« no previous file with comments | « headless/lib/browser/headless_focus_client.cc ('k') | headless/lib/headless_web_contents_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698