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 1529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1540 } | 1540 } |
1541 | 1541 |
1542 void RenderFrameHostImpl::Stop() { | 1542 void RenderFrameHostImpl::Stop() { |
1543 Send(new FrameMsg_Stop(routing_id_)); | 1543 Send(new FrameMsg_Stop(routing_id_)); |
1544 } | 1544 } |
1545 | 1545 |
1546 void RenderFrameHostImpl::DispatchBeforeUnload(bool for_navigation) { | 1546 void RenderFrameHostImpl::DispatchBeforeUnload(bool for_navigation) { |
1547 // TODO(creis): Support beforeunload on subframes. For now just pretend that | 1547 // TODO(creis): Support beforeunload on subframes. For now just pretend that |
1548 // the handler ran and allowed the navigation to proceed. | 1548 // the handler ran and allowed the navigation to proceed. |
1549 if (GetParent() || !IsRenderFrameLive()) { | 1549 if (GetParent() || !IsRenderFrameLive()) { |
1550 // We don't have a live renderer, so just skip running beforeunload. | 1550 // If there's no live renderer or this is a subframe navigation then just |
clamy
2015/02/11 10:54:27
Please remove this change. The subframe navigation
carlosk
2015/02/11 15:36:21
OK, reverted as it's being updated anyway in anoth
| |
1551 // skip running beforeunload. | |
1551 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 1552 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
1552 switches::kEnableBrowserSideNavigation)) { | 1553 switches::kEnableBrowserSideNavigation)) { |
1553 frame_tree_node_->navigator()->OnBeforeUnloadACK( | 1554 frame_tree_node_->navigator()->OnBeforeUnloadACK( |
1554 frame_tree_node_, true); | 1555 frame_tree_node_, true); |
1555 } else { | 1556 } else { |
1556 frame_tree_node_->render_manager()->OnBeforeUnloadACK( | 1557 frame_tree_node_->render_manager()->OnBeforeUnloadACK( |
1557 for_navigation, true, base::TimeTicks::Now()); | 1558 for_navigation, true, base::TimeTicks::Now()); |
1558 } | 1559 } |
1559 return; | 1560 return; |
1560 } | 1561 } |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1879 void RenderFrameHostImpl::DidUseGeolocationPermission() { | 1880 void RenderFrameHostImpl::DidUseGeolocationPermission() { |
1880 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); | 1881 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); |
1881 GetContentClient()->browser()->RegisterPermissionUsage( | 1882 GetContentClient()->browser()->RegisterPermissionUsage( |
1882 PERMISSION_GEOLOCATION, | 1883 PERMISSION_GEOLOCATION, |
1883 delegate_->GetAsWebContents(), | 1884 delegate_->GetAsWebContents(), |
1884 GetLastCommittedURL().GetOrigin(), | 1885 GetLastCommittedURL().GetOrigin(), |
1885 top_frame->GetLastCommittedURL().GetOrigin()); | 1886 top_frame->GetLastCommittedURL().GetOrigin()); |
1886 } | 1887 } |
1887 | 1888 |
1888 } // namespace content | 1889 } // namespace content |
OLD | NEW |