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

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: comments and TODO Created 5 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
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 b6271742deb959eb7c97a43a45d6e082593f413b..cb77762343f82bc2f2214894c6a602aa06681aba 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -278,6 +278,8 @@ ServiceRegistry* RenderFrameHostImpl::GetServiceRegistry() {
}
blink::WebPageVisibilityState RenderFrameHostImpl::GetVisibilityState() {
+ // TODO(mlamouri,kenrb): call directly GetRenderWidgetHost() when it stops
Charlie Reis 2015/02/04 17:32:42 nit: call GetRenderWidgetHost directly
mlamouri (slow - plz ping) 2015/02/04 17:44:11 Done.
+ // returning nullptr in some cases, https://crbug.com/455245
Charlie Reis 2015/02/04 17:32:42 nit: Period after "cases," then "See ..." Also pe
mlamouri (slow - plz ping) 2015/02/04 17:44:11 Done.
blink::WebPageVisibilityState visibility_state =
RenderWidgetHostImpl::From(GetView()->GetRenderWidgetHost())->is_hidden()
? blink::WebPageVisibilityStateHidden
@@ -1602,7 +1604,10 @@ void RenderFrameHostImpl::InvalidateMojoConnection() {
}
bool RenderFrameHostImpl::IsFocused() {
Charlie Reis 2015/02/04 17:32:42 The comment for this method in the .h file is now
mlamouri (slow - plz ping) 2015/02/04 17:44:11 Done.
- return GetView()->HasFocus() &&
+ // TODO(mlamouri,kenrb): call directly GetRenderWidgetHost() when it stops
Charlie Reis 2015/02/04 17:32:43 Same nits as above.
mlamouri (slow - plz ping) 2015/02/04 17:44:11 Done.
+ // returning nullptr in some cases, https://crbug.com/455245
+ return RenderWidgetHostImpl::From(
+ GetView()->GetRenderWidgetHost())->is_focused() &&
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