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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 860393004: Expose whether a frame is focused to the browser process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 5 years, 11 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
Index: content/browser/renderer_host/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 2d695c3d0d42b804dcc5c9295ac012a97d1f70dd..708ee29aa846d87955e7df6dc9128ac5e9623a13 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -184,6 +184,7 @@ RenderWidgetHostImpl::RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate,
allow_privileged_mouse_lock_(false),
has_touch_handler_(false),
next_browser_snapshot_id_(1),
+ is_focused_(false),
weak_factory_(this) {
CHECK(delegate_);
if (routing_id_ == MSG_ROUTING_NONE) {
@@ -650,10 +651,13 @@ void RenderWidgetHostImpl::GotFocus() {
}
void RenderWidgetHostImpl::Focus() {
+ is_focused_ = true;
Send(new InputMsg_SetFocus(routing_id_, true));
}
void RenderWidgetHostImpl::Blur() {
+ is_focused_ = false;
+
// If there is a pending mouse lock request, we don't want to reject it at
// this point. The user can switch focus back to this view and approve the
// request later.

Powered by Google App Engine
This is Rietveld 408576698