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

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

Issue 801613004: Implement WebPermissionClient for Document and Worker contexts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: with comments Created 5 years, 9 months 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
11 namespace { 11 namespace {
12 12
13 PermissionType PermissionNameToPermissionType(PermissionName name) { 13 PermissionType PermissionNameToPermissionType(PermissionName name) {
14 switch(name) { 14 switch(name) {
15 case PERMISSION_NAME_GEOLOCATION: 15 case PERMISSION_NAME_GEOLOCATION:
16 return PERMISSION_GEOLOCATION; 16 return PERMISSION_GEOLOCATION;
17 case PERMISSION_NAME_NOTIFICATIONS:
18 return PERMISSION_NOTIFICATIONS;
19 case PERMISSION_NAME_PUSH_NOTIFICATIONS:
20 return PERMISSION_PUSH_MESSAGING;
17 case PERMISSION_NAME_MIDI_SYSEX: 21 case PERMISSION_NAME_MIDI_SYSEX:
18 return PERMISSION_MIDI_SYSEX; 22 return PERMISSION_MIDI_SYSEX;
19 case PERMISSION_NAME_NOTIFICATIONS:
20 return PERMISSION_NOTIFICATIONS;
21 case PERMISSION_NAME_PROTECTED_MEDIA_IDENTIFIER: 23 case PERMISSION_NAME_PROTECTED_MEDIA_IDENTIFIER:
22 return PERMISSION_PROTECTED_MEDIA_IDENTIFIER; 24 return PERMISSION_PROTECTED_MEDIA_IDENTIFIER;
23 } 25 }
24 26
25 NOTREACHED(); 27 NOTREACHED();
26 return PERMISSION_NUM; 28 return PERMISSION_NUM;
27 } 29 }
28 30
29 } // anonymous namespace 31 } // anonymous namespace
30 32
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 void PermissionServiceImpl::ResetPermissionStatus(PermissionType type, 150 void PermissionServiceImpl::ResetPermissionStatus(PermissionType type,
149 GURL origin) { 151 GURL origin) {
150 // If the embedding_origin is empty we'll use |origin| instead. 152 // If the embedding_origin is empty we'll use |origin| instead.
151 GURL embedding_origin = context_->GetEmbeddingOrigin(); 153 GURL embedding_origin = context_->GetEmbeddingOrigin();
152 GetContentClient()->browser()->ResetPermission( 154 GetContentClient()->browser()->ResetPermission(
153 type, context_->GetBrowserContext(), origin, 155 type, context_->GetBrowserContext(), origin,
154 embedding_origin.is_empty() ? origin : embedding_origin); 156 embedding_origin.is_empty() ? origin : embedding_origin);
155 } 157 }
156 158
157 } // namespace content 159 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/child/blink_platform_impl.h » ('j') | content/child/blink_platform_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698