OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/permissions/permission_service_context.h" | 5 #include "content/browser/permissions/permission_service_context.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "content/browser/permissions/permission_service_impl.h" | 9 #include "content/browser/permissions/permission_service_impl.h" |
10 #include "content/public/browser/browser_context.h" | 10 #include "content/public/browser/browser_context.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 CancelPendingOperations(old_host); | 124 CancelPendingOperations(old_host); |
125 } | 125 } |
126 | 126 |
127 void PermissionServiceContext::FrameDeleted( | 127 void PermissionServiceContext::FrameDeleted( |
128 RenderFrameHost* render_frame_host) { | 128 RenderFrameHost* render_frame_host) { |
129 CancelPendingOperations(render_frame_host); | 129 CancelPendingOperations(render_frame_host); |
130 } | 130 } |
131 | 131 |
132 void PermissionServiceContext::DidFinishNavigation( | 132 void PermissionServiceContext::DidFinishNavigation( |
133 NavigationHandle* navigation_handle) { | 133 NavigationHandle* navigation_handle) { |
134 if (!navigation_handle->HasCommitted() || navigation_handle->IsSamePage()) | 134 if (!navigation_handle->HasCommitted() || navigation_handle->IsSameDocument()) |
135 return; | 135 return; |
136 | 136 |
137 CancelPendingOperations(navigation_handle->GetRenderFrameHost()); | 137 CancelPendingOperations(navigation_handle->GetRenderFrameHost()); |
138 } | 138 } |
139 | 139 |
140 void PermissionServiceContext::CancelPendingOperations( | 140 void PermissionServiceContext::CancelPendingOperations( |
141 RenderFrameHost* render_frame_host) { | 141 RenderFrameHost* render_frame_host) { |
142 DCHECK(render_frame_host_); | 142 DCHECK(render_frame_host_); |
143 if (render_frame_host != render_frame_host_) | 143 if (render_frame_host != render_frame_host_) |
144 return; | 144 return; |
(...skipping 15 matching lines...) Expand all Loading... |
160 GURL PermissionServiceContext::GetEmbeddingOrigin() const { | 160 GURL PermissionServiceContext::GetEmbeddingOrigin() const { |
161 return web_contents() ? web_contents()->GetLastCommittedURL().GetOrigin() | 161 return web_contents() ? web_contents()->GetLastCommittedURL().GetOrigin() |
162 : GURL(); | 162 : GURL(); |
163 } | 163 } |
164 | 164 |
165 RenderFrameHost* PermissionServiceContext::render_frame_host() const { | 165 RenderFrameHost* PermissionServiceContext::render_frame_host() const { |
166 return render_frame_host_; | 166 return render_frame_host_; |
167 } | 167 } |
168 | 168 |
169 } // namespace content | 169 } // namespace content |
OLD | NEW |