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 |
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_MIDI_SYSEX: | 17 case PERMISSION_NAME_MIDI_SYSEX: |
18 return PERMISSION_MIDI_SYSEX; | 18 return PERMISSION_MIDI_SYSEX; |
19 case PERMISSION_NAME_NOTIFICATIONS: | 19 case PERMISSION_NAME_NOTIFICATIONS: |
20 return PERMISSION_NOTIFICATIONS; | 20 return PERMISSION_NOTIFICATIONS; |
21 case PERMISSION_NAME_PROTECTED_MEDIA_IDENTIFIER: | 21 case PERMISSION_NAME_PROTECTED_MEDIA_IDENTIFIER: |
22 return PERMISSION_PROTECTED_MEDIA; | 22 return PERMISSION_PROTECTED_MEDIA_IDENTIFIER; |
23 } | 23 } |
24 | 24 |
25 NOTREACHED(); | 25 NOTREACHED(); |
26 return PERMISSION_NUM; | 26 return PERMISSION_NUM; |
27 } | 27 } |
28 | 28 |
29 } // anonymous namespace | 29 } // anonymous namespace |
30 | 30 |
31 PermissionServiceImpl::PendingRequest::PendingRequest(PermissionType permission, | 31 PermissionServiceImpl::PendingRequest::PendingRequest(PermissionType permission, |
32 const GURL& origin) | 32 const GURL& origin) |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 GURL embedding_origin = context_->GetEmbeddingOrigin(); | 118 GURL embedding_origin = context_->GetEmbeddingOrigin(); |
119 | 119 |
120 callback.Run(GetContentClient()->browser()->GetPermissionStatus( | 120 callback.Run(GetContentClient()->browser()->GetPermissionStatus( |
121 PermissionNameToPermissionType(permission), | 121 PermissionNameToPermissionType(permission), |
122 context_->GetBrowserContext(), | 122 context_->GetBrowserContext(), |
123 GURL(origin), | 123 GURL(origin), |
124 embedding_origin.is_empty() ? GURL(origin) : embedding_origin)); | 124 embedding_origin.is_empty() ? GURL(origin) : embedding_origin)); |
125 } | 125 } |
126 | 126 |
127 } // namespace content | 127 } // namespace content |
OLD | NEW |