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 #include "content/public/browser/permission_type.h" |
8 | 9 |
9 namespace content { | 10 namespace content { |
10 | 11 |
11 namespace { | 12 namespace { |
12 | 13 |
13 PermissionType PermissionNameToPermissionType(PermissionName name) { | 14 PermissionType PermissionNameToPermissionType(PermissionName name) { |
14 switch(name) { | 15 switch(name) { |
15 case PERMISSION_NAME_GEOLOCATION: | 16 case PERMISSION_NAME_GEOLOCATION: |
16 return PERMISSION_GEOLOCATION; | 17 return PermissionType::GEOLOCATION; |
17 case PERMISSION_NAME_NOTIFICATIONS: | 18 case PERMISSION_NAME_NOTIFICATIONS: |
18 return PERMISSION_NOTIFICATIONS; | 19 return PermissionType::NOTIFICATIONS; |
19 case PERMISSION_NAME_PUSH_NOTIFICATIONS: | 20 case PERMISSION_NAME_PUSH_NOTIFICATIONS: |
20 return PERMISSION_PUSH_MESSAGING; | 21 return PermissionType::PUSH_MESSAGING; |
21 case PERMISSION_NAME_MIDI_SYSEX: | 22 case PERMISSION_NAME_MIDI_SYSEX: |
22 return PERMISSION_MIDI_SYSEX; | 23 return PermissionType::MIDI_SYSEX; |
23 case PERMISSION_NAME_PROTECTED_MEDIA_IDENTIFIER: | 24 case PERMISSION_NAME_PROTECTED_MEDIA_IDENTIFIER: |
24 return PERMISSION_PROTECTED_MEDIA_IDENTIFIER; | 25 return PermissionType::PROTECTED_MEDIA_IDENTIFIER; |
25 } | 26 } |
26 | 27 |
27 NOTREACHED(); | 28 NOTREACHED(); |
28 return PERMISSION_NUM; | 29 return PermissionType::NUM; |
29 } | 30 } |
30 | 31 |
31 } // anonymous namespace | 32 } // anonymous namespace |
32 | 33 |
33 PermissionServiceImpl::PendingRequest::PendingRequest( | 34 PermissionServiceImpl::PendingRequest::PendingRequest( |
34 PermissionType permission, | 35 PermissionType permission, |
35 const GURL& origin, | 36 const GURL& origin, |
36 const mojo::Callback<void(PermissionStatus)>& callback) | 37 const mojo::Callback<void(PermissionStatus)>& callback) |
37 : permission(permission), | 38 : permission(permission), |
38 origin(origin), | 39 origin(origin), |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 void PermissionServiceImpl::ResetPermissionStatus(PermissionType type, | 160 void PermissionServiceImpl::ResetPermissionStatus(PermissionType type, |
160 GURL origin) { | 161 GURL origin) { |
161 // If the embedding_origin is empty we'll use |origin| instead. | 162 // If the embedding_origin is empty we'll use |origin| instead. |
162 GURL embedding_origin = context_->GetEmbeddingOrigin(); | 163 GURL embedding_origin = context_->GetEmbeddingOrigin(); |
163 GetContentClient()->browser()->ResetPermission( | 164 GetContentClient()->browser()->ResetPermission( |
164 type, context_->GetBrowserContext(), origin, | 165 type, context_->GetBrowserContext(), origin, |
165 embedding_origin.is_empty() ? origin : embedding_origin); | 166 embedding_origin.is_empty() ? origin : embedding_origin); |
166 } | 167 } |
167 | 168 |
168 } // namespace content | 169 } // namespace content |
OLD | NEW |