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

Side by Side 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, 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 1539 matching lines...) Expand 10 before | Expand all | Expand 10 after
1550 void RenderFrameHostImpl::InvalidateMojoConnection() { 1550 void RenderFrameHostImpl::InvalidateMojoConnection() {
1551 #if defined(OS_ANDROID) 1551 #if defined(OS_ANDROID)
1552 // The Android-specific service registry has a reference to 1552 // The Android-specific service registry has a reference to
1553 // |service_registry_| and thus must be torn down first. 1553 // |service_registry_| and thus must be torn down first.
1554 service_registry_android_.reset(); 1554 service_registry_android_.reset();
1555 #endif 1555 #endif
1556 1556
1557 service_registry_.reset(); 1557 service_registry_.reset();
1558 } 1558 }
1559 1559
1560 bool RenderFrameHostImpl::IsFocused() {
1561 return GetView()->HasFocus() &&
1562 frame_tree_->GetFocusedFrame() &&
1563 (frame_tree_->GetFocusedFrame() == frame_tree_node() ||
1564 frame_tree_->GetFocusedFrame()->IsDescendantOf(frame_tree_node()));
1565 }
1566
1560 void RenderFrameHostImpl::UpdateCrossProcessIframeAccessibility( 1567 void RenderFrameHostImpl::UpdateCrossProcessIframeAccessibility(
1561 const std::map<int32, int>& node_to_frame_routing_id_map) { 1568 const std::map<int32, int>& node_to_frame_routing_id_map) {
1562 for (const auto& iter : node_to_frame_routing_id_map) { 1569 for (const auto& iter : node_to_frame_routing_id_map) {
1563 // This is the id of the accessibility node that has a child frame. 1570 // This is the id of the accessibility node that has a child frame.
1564 int32 node_id = iter.first; 1571 int32 node_id = iter.first;
1565 // The routing id from either a RenderFrame or a RenderFrameProxy. 1572 // The routing id from either a RenderFrame or a RenderFrameProxy.
1566 int frame_routing_id = iter.second; 1573 int frame_routing_id = iter.second;
1567 1574
1568 FrameTree* frame_tree = frame_tree_node()->frame_tree(); 1575 FrameTree* frame_tree = frame_tree_node()->frame_tree();
1569 FrameTreeNode* child_frame_tree_node = frame_tree->FindByRoutingID( 1576 FrameTreeNode* child_frame_tree_node = frame_tree->FindByRoutingID(
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
1728 void RenderFrameHostImpl::DidUseGeolocationPermission() { 1735 void RenderFrameHostImpl::DidUseGeolocationPermission() {
1729 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); 1736 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame();
1730 GetContentClient()->browser()->RegisterPermissionUsage( 1737 GetContentClient()->browser()->RegisterPermissionUsage(
1731 PERMISSION_GEOLOCATION, 1738 PERMISSION_GEOLOCATION,
1732 delegate_->GetAsWebContents(), 1739 delegate_->GetAsWebContents(),
1733 GetLastCommittedURL().GetOrigin(), 1740 GetLastCommittedURL().GetOrigin(),
1734 top_frame->GetLastCommittedURL().GetOrigin()); 1741 top_frame->GetLastCommittedURL().GetOrigin());
1735 } 1742 }
1736 1743
1737 } // namespace content 1744 } // namespace content
OLDNEW
« 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