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

Unified Diff: content/browser/frame_host/render_frame_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: Cleaned up 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 c2149ef974c0bae4980c7edcf7e0b79565852b37..8f998df3621b81101c3ded3a71b562b27e0c5927 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1540,6 +1540,13 @@ void RenderFrameHostImpl::InvalidateMojoConnection() {
service_registry_.reset();
}
+bool RenderFrameHostImpl::IsFocused() {
+ return GetView()->HasFocus() &&
+ frame_tree_->GetFocusedFrame() &&
+ (frame_tree_->GetFocusedFrame() == frame_tree_node() ||
+ frame_tree_->GetFocusedFrame()->IsDescendantOf(frame_tree_node()));
+}
+
void RenderFrameHostImpl::UpdateCrossProcessIframeAccessibility(
const std::map<int32, int>& node_to_frame_routing_id_map) {
for (const auto& iter : node_to_frame_routing_id_map) {

Powered by Google App Engine
This is Rietveld 408576698