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

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: 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 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 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after
1533 void RenderFrameHostImpl::InvalidateMojoConnection() { 1533 void RenderFrameHostImpl::InvalidateMojoConnection() {
1534 #if defined(OS_ANDROID) 1534 #if defined(OS_ANDROID)
1535 // The Android-specific service registry has a reference to 1535 // The Android-specific service registry has a reference to
1536 // |service_registry_| and thus must be torn down first. 1536 // |service_registry_| and thus must be torn down first.
1537 service_registry_android_.reset(); 1537 service_registry_android_.reset();
1538 #endif 1538 #endif
1539 1539
1540 service_registry_.reset(); 1540 service_registry_.reset();
1541 } 1541 }
1542 1542
1543 bool RenderFrameHostImpl::IsFocused() {
1544 return GetView()->HasFocus() &&
1545 frame_tree_->GetFocusedFrame() &&
1546 (frame_tree_->GetFocusedFrame() == frame_tree_node() ||
1547 frame_tree_->GetFocusedFrame()->IsDescendantOf(frame_tree_node()));
1548 }
1549
1543 void RenderFrameHostImpl::UpdateCrossProcessIframeAccessibility( 1550 void RenderFrameHostImpl::UpdateCrossProcessIframeAccessibility(
1544 const std::map<int32, int>& node_to_frame_routing_id_map) { 1551 const std::map<int32, int>& node_to_frame_routing_id_map) {
1545 for (const auto& iter : node_to_frame_routing_id_map) { 1552 for (const auto& iter : node_to_frame_routing_id_map) {
1546 // This is the id of the accessibility node that has a child frame. 1553 // This is the id of the accessibility node that has a child frame.
1547 int32 node_id = iter.first; 1554 int32 node_id = iter.first;
1548 // The routing id from either a RenderFrame or a RenderFrameProxy. 1555 // The routing id from either a RenderFrame or a RenderFrameProxy.
1549 int frame_routing_id = iter.second; 1556 int frame_routing_id = iter.second;
1550 1557
1551 FrameTree* frame_tree = frame_tree_node()->frame_tree(); 1558 FrameTree* frame_tree = frame_tree_node()->frame_tree();
1552 FrameTreeNode* child_frame_tree_node = frame_tree->FindByRoutingID( 1559 FrameTreeNode* child_frame_tree_node = frame_tree->FindByRoutingID(
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
1711 void RenderFrameHostImpl::DidUseGeolocationPermission() { 1718 void RenderFrameHostImpl::DidUseGeolocationPermission() {
1712 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); 1719 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame();
1713 GetContentClient()->browser()->RegisterPermissionUsage( 1720 GetContentClient()->browser()->RegisterPermissionUsage(
1714 PERMISSION_GEOLOCATION, 1721 PERMISSION_GEOLOCATION,
1715 delegate_->GetAsWebContents(), 1722 delegate_->GetAsWebContents(),
1716 GetLastCommittedURL().GetOrigin(), 1723 GetLastCommittedURL().GetOrigin(),
1717 top_frame->GetLastCommittedURL().GetOrigin()); 1724 top_frame->GetLastCommittedURL().GetOrigin());
1718 } 1725 }
1719 1726
1720 } // namespace content 1727 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698