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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 898443003: Use RWH instead of RWHV to know whether a frame is focus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 1576 matching lines...) Expand 10 before | Expand all | Expand 10 after
1587 #if defined(OS_ANDROID) 1587 #if defined(OS_ANDROID)
1588 // The Android-specific service registry has a reference to 1588 // The Android-specific service registry has a reference to
1589 // |service_registry_| and thus must be torn down first. 1589 // |service_registry_| and thus must be torn down first.
1590 service_registry_android_.reset(); 1590 service_registry_android_.reset();
1591 #endif 1591 #endif
1592 1592
1593 service_registry_.reset(); 1593 service_registry_.reset();
1594 } 1594 }
1595 1595
1596 bool RenderFrameHostImpl::IsFocused() { 1596 bool RenderFrameHostImpl::IsFocused() {
1597 return GetView()->HasFocus() && 1597 return RenderWidgetHostImpl::From(
1598 GetView()->GetRenderWidgetHost())->is_focused() &&
Charlie Reis 2015/02/02 18:03:55 This is pretty awkward. Ken, this is the kind of
mlamouri (slow - plz ping) 2015/02/02 18:21:15 Yes, GetRenderWidgetHost() doesn't behave like I w
kenrb 2015/02/02 18:28:17 I agree it is awkward. I am okay with it because I
Charlie Reis 2015/02/02 18:34:49 Ok, please file a bug and add a TODO. I think thi
Charlie Reis 2015/02/02 18:34:49 This is exactly what's bothering me about this CL.
1598 frame_tree_->GetFocusedFrame() && 1599 frame_tree_->GetFocusedFrame() &&
1599 (frame_tree_->GetFocusedFrame() == frame_tree_node() || 1600 (frame_tree_->GetFocusedFrame() == frame_tree_node() ||
1600 frame_tree_->GetFocusedFrame()->IsDescendantOf(frame_tree_node())); 1601 frame_tree_->GetFocusedFrame()->IsDescendantOf(frame_tree_node()));
1601 } 1602 }
1602 1603
1603 void RenderFrameHostImpl::UpdateCrossProcessIframeAccessibility( 1604 void RenderFrameHostImpl::UpdateCrossProcessIframeAccessibility(
1604 const std::map<int32, int>& node_to_frame_routing_id_map) { 1605 const std::map<int32, int>& node_to_frame_routing_id_map) {
1605 for (const auto& iter : node_to_frame_routing_id_map) { 1606 for (const auto& iter : node_to_frame_routing_id_map) {
1606 // This is the id of the accessibility node that has a child frame. 1607 // This is the id of the accessibility node that has a child frame.
1607 int32 node_id = iter.first; 1608 int32 node_id = iter.first;
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
1771 void RenderFrameHostImpl::DidUseGeolocationPermission() { 1772 void RenderFrameHostImpl::DidUseGeolocationPermission() {
1772 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); 1773 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame();
1773 GetContentClient()->browser()->RegisterPermissionUsage( 1774 GetContentClient()->browser()->RegisterPermissionUsage(
1774 PERMISSION_GEOLOCATION, 1775 PERMISSION_GEOLOCATION,
1775 delegate_->GetAsWebContents(), 1776 delegate_->GetAsWebContents(),
1776 GetLastCommittedURL().GetOrigin(), 1777 GetLastCommittedURL().GetOrigin(),
1777 top_frame->GetLastCommittedURL().GetOrigin()); 1778 top_frame->GetLastCommittedURL().GetOrigin());
1778 } 1779 }
1779 1780
1780 } // namespace content 1781 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698