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 "content/browser/permissions/permission_service_impl.h" | 7 #include "content/browser/permissions/permission_service_impl.h" |
8 #include "content/public/browser/navigation_details.h" | 8 #include "content/public/browser/navigation_details.h" |
9 #include "content/public/browser/render_frame_host.h" | 9 #include "content/public/browser/render_frame_host.h" |
10 #include "content/public/browser/render_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 RenderProcessHost* render_process_host) | 23 RenderProcessHost* render_process_host) |
24 : WebContentsObserver(nullptr), | 24 : WebContentsObserver(nullptr), |
25 render_frame_host_(nullptr), | 25 render_frame_host_(nullptr), |
26 render_process_host_(render_process_host) { | 26 render_process_host_(render_process_host) { |
27 } | 27 } |
28 | 28 |
29 PermissionServiceContext::~PermissionServiceContext() { | 29 PermissionServiceContext::~PermissionServiceContext() { |
30 } | 30 } |
31 | 31 |
32 void PermissionServiceContext::CreateService( | 32 void PermissionServiceContext::CreateService( |
33 mojo::InterfaceRequest<PermissionService> request) { | 33 mojo::InterfaceRequest<permission::PermissionService> request) { |
34 services_.push_back(new PermissionServiceImpl(this, request.Pass())); | 34 services_.push_back(new PermissionServiceImpl(this, request.Pass())); |
35 } | 35 } |
36 | 36 |
37 void PermissionServiceContext::ServiceHadConnectionError( | 37 void PermissionServiceContext::ServiceHadConnectionError( |
38 PermissionServiceImpl* service) { | 38 PermissionServiceImpl* service) { |
39 auto it = std::find(services_.begin(), services_.end(), service); | 39 auto it = std::find(services_.begin(), services_.end(), service); |
40 DCHECK(it != services_.end()); | 40 DCHECK(it != services_.end()); |
41 services_.erase(it); | 41 services_.erase(it); |
42 } | 42 } |
43 | 43 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 GURL PermissionServiceContext::GetEmbeddingOrigin() const { | 83 GURL PermissionServiceContext::GetEmbeddingOrigin() const { |
84 return web_contents() ? web_contents()->GetLastCommittedURL().GetOrigin() | 84 return web_contents() ? web_contents()->GetLastCommittedURL().GetOrigin() |
85 : GURL(); | 85 : GURL(); |
86 } | 86 } |
87 | 87 |
88 RenderFrameHost* PermissionServiceContext::render_frame_host() const { | 88 RenderFrameHost* PermissionServiceContext::render_frame_host() const { |
89 return render_frame_host_; | 89 return render_frame_host_; |
90 } | 90 } |
91 | 91 |
92 } // namespace content | 92 } // namespace content |
OLD | NEW |