| 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_impl.h" | 5 #include "content/browser/permissions/permission_service_impl.h" |
| 6 | 6 |
| 7 #include "content/public/browser/content_browser_client.h" | 7 #include "content/public/browser/content_browser_client.h" |
| 8 | 8 |
| 9 namespace content { | 9 namespace content { |
| 10 | 10 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 it.GetCurrentValue()->origin); | 102 it.GetCurrentValue()->origin); |
| 103 } | 103 } |
| 104 | 104 |
| 105 pending_requests_.Clear(); | 105 pending_requests_.Clear(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void PermissionServiceImpl::HasPermission( | 108 void PermissionServiceImpl::HasPermission( |
| 109 PermissionName permission, | 109 PermissionName permission, |
| 110 const mojo::String& origin, | 110 const mojo::String& origin, |
| 111 const mojo::Callback<void(PermissionStatus)>& callback) { | 111 const mojo::Callback<void(PermissionStatus)>& callback) { |
| 112 DCHECK(context_->GetBrowserContext()); | 112 NOTIMPLEMENTED(); |
| 113 | |
| 114 // If the embedding_origin is empty we'll use |origin| instead. | |
| 115 GURL embedding_origin = context_->GetEmbeddingOrigin(); | |
| 116 | |
| 117 callback.Run(GetContentClient()->browser()->GetPermissionStatus( | |
| 118 PermissionNameToPermissionType(permission), | |
| 119 context_->GetBrowserContext(), | |
| 120 GURL(origin), | |
| 121 embedding_origin.is_empty() ? GURL(origin) : embedding_origin)); | |
| 122 } | 113 } |
| 123 | 114 |
| 124 } // namespace content | 115 } // namespace content |
| OLD | NEW |