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

Side by Side Diff: content/browser/permissions/permission_service_impl.cc

Issue 750633003: Implement HasPermission() method in PermissionService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add dependencies to content_app, content_child and content_ppapi_plugin Created 6 years 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 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
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 NOTIMPLEMENTED(); 112 DCHECK(context_->GetBrowserContext());
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));
113 } 122 }
114 123
115 } // namespace content 124 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698