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

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

Issue 819463002: Implement RevokePermission() method in PermissionService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 // If the embedding_origin is empty we'll use |origin| instead. 114 // If the embedding_origin is empty we'll use |origin| instead.
115 GURL embedding_origin = context_->GetEmbeddingOrigin(); 115 GURL embedding_origin = context_->GetEmbeddingOrigin();
116 116
117 callback.Run(GetContentClient()->browser()->GetPermissionStatus( 117 callback.Run(GetContentClient()->browser()->GetPermissionStatus(
118 PermissionNameToPermissionType(permission), 118 PermissionNameToPermissionType(permission),
119 context_->GetBrowserContext(), 119 context_->GetBrowserContext(),
120 GURL(origin), 120 GURL(origin),
121 embedding_origin.is_empty() ? GURL(origin) : embedding_origin)); 121 embedding_origin.is_empty() ? GURL(origin) : embedding_origin));
122 } 122 }
123 123
124 void PermissionServiceImpl::RevokePermission(
125 PermissionName permission,
126 const mojo::String& origin,
127 const mojo::Callback<void(PermissionStatus)>& callback) {
128 // If the embedding_origin is empty we'll use |origin| instead.
129 GURL embedding_origin = context_->GetEmbeddingOrigin();
130
131 callback.Run(GetContentClient()->browser()->RevokePermission(
132 PermissionNameToPermissionType(permission),
133 context_->GetBrowserContext(),
134 GURL(origin),
135 embedding_origin.is_empty() ? GURL(origin) : embedding_origin));
136 }
137
138
124 } // namespace content 139 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698