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

Unified Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 898443003: Use RWH instead of RWHV to know whether a frame is focus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 5878180ae16a4662195f58f2e417b14557f21ec0..a4cd6423ec7ac1c6aee265a4d6828e28019fa651 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1594,7 +1594,8 @@ void RenderFrameHostImpl::InvalidateMojoConnection() {
}
bool RenderFrameHostImpl::IsFocused() {
- return GetView()->HasFocus() &&
+ return RenderWidgetHostImpl::From(
+ GetView()->GetRenderWidgetHost())->is_focused() &&
Charlie Reis 2015/02/02 18:03:55 This is pretty awkward. Ken, this is the kind of
mlamouri (slow - plz ping) 2015/02/02 18:21:15 Yes, GetRenderWidgetHost() doesn't behave like I w
kenrb 2015/02/02 18:28:17 I agree it is awkward. I am okay with it because I
Charlie Reis 2015/02/02 18:34:49 Ok, please file a bug and add a TODO. I think thi
Charlie Reis 2015/02/02 18:34:49 This is exactly what's bothering me about this CL.
frame_tree_->GetFocusedFrame() &&
(frame_tree_->GetFocusedFrame() == frame_tree_node() ||
frame_tree_->GetFocusedFrame()->IsDescendantOf(frame_tree_node()));

Powered by Google App Engine
This is Rietveld 408576698