OLD | NEW |
---|---|
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 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1470 | 1470 |
1471 service_registry_.reset(); | 1471 service_registry_.reset(); |
1472 } | 1472 } |
1473 | 1473 |
1474 bool RenderFrameHostImpl::IsFocused() const { | 1474 bool RenderFrameHostImpl::IsFocused() const { |
1475 return GetRenderWidgetHost()->is_focused() && | 1475 return GetRenderWidgetHost()->is_focused() && |
1476 frame_tree_->GetFocusedFrame() && | 1476 frame_tree_->GetFocusedFrame() && |
1477 frame_tree_->GetFocusedFrame()->current_frame_host() == this; | 1477 frame_tree_->GetFocusedFrame()->current_frame_host() == this; |
1478 } | 1478 } |
1479 | 1479 |
1480 blink::WebPageVisibilityState RenderFrameHostImpl::GetVisibilityState() { | |
1481 if (GetContentClient()->browser()->IsPrerendering(this)) | |
1482 return blink::WebPageVisibilityStatePrerender; | |
1483 | |
1484 return GetRenderWidgetHost()->is_hidden() | |
1485 ? blink::WebPageVisibilityStateHidden | |
Charlie Reis
2015/01/22 21:03:55
This indent doesn't seem right. I would have done
mlamouri (slow - plz ping)
2015/01/23 12:32:57
Fixed.
| |
1486 : blink::WebPageVisibilityStateVisible; | |
1487 } | |
1488 | |
1480 void RenderFrameHostImpl::UpdateCrossProcessIframeAccessibility( | 1489 void RenderFrameHostImpl::UpdateCrossProcessIframeAccessibility( |
1481 const std::map<int32, int>& node_to_frame_routing_id_map) { | 1490 const std::map<int32, int>& node_to_frame_routing_id_map) { |
1482 for (const auto& iter : node_to_frame_routing_id_map) { | 1491 for (const auto& iter : node_to_frame_routing_id_map) { |
1483 // This is the id of the accessibility node that has a child frame. | 1492 // This is the id of the accessibility node that has a child frame. |
1484 int32 node_id = iter.first; | 1493 int32 node_id = iter.first; |
1485 // The routing id from either a RenderFrame or a RenderFrameProxy. | 1494 // The routing id from either a RenderFrame or a RenderFrameProxy. |
1486 int frame_routing_id = iter.second; | 1495 int frame_routing_id = iter.second; |
1487 | 1496 |
1488 FrameTree* frame_tree = frame_tree_node()->frame_tree(); | 1497 FrameTree* frame_tree = frame_tree_node()->frame_tree(); |
1489 FrameTreeNode* child_frame_tree_node = frame_tree->FindByRoutingID( | 1498 FrameTreeNode* child_frame_tree_node = frame_tree->FindByRoutingID( |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1648 void RenderFrameHostImpl::DidUseGeolocationPermission() { | 1657 void RenderFrameHostImpl::DidUseGeolocationPermission() { |
1649 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); | 1658 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); |
1650 GetContentClient()->browser()->RegisterPermissionUsage( | 1659 GetContentClient()->browser()->RegisterPermissionUsage( |
1651 PERMISSION_GEOLOCATION, | 1660 PERMISSION_GEOLOCATION, |
1652 delegate_->GetAsWebContents(), | 1661 delegate_->GetAsWebContents(), |
1653 GetLastCommittedURL().GetOrigin(), | 1662 GetLastCommittedURL().GetOrigin(), |
1654 top_frame->GetLastCommittedURL().GetOrigin()); | 1663 top_frame->GetLastCommittedURL().GetOrigin()); |
1655 } | 1664 } |
1656 | 1665 |
1657 } // namespace content | 1666 } // namespace content |
OLD | NEW |