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

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: kenrb review comment 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 27943c8621494e0de62a4ab6922efe1d39fc7462..054b039fe8e6613d741c9402e046c0aefe493167 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1557,6 +1557,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) {
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/frame_host/render_frame_host_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698