Chromium Code Reviews| 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: | |
| 22 return PERMISSION_PROTECTED_MEDIA; | |
|
xhwang
2015/01/22 23:40:54
We have some inconsistency here:
PROTECTED_MEDIA_
sandersd (OOO until July 31)
2015/01/24 00:49:21
I agree, consistency is good, and the identifier s
xhwang
2015/01/26 21:49:06
sg; I'll update the name in a separate CL.
| |
| 21 } | 23 } |
| 22 | 24 |
| 23 NOTREACHED(); | 25 NOTREACHED(); |
| 24 return PERMISSION_NUM; | 26 return PERMISSION_NUM; |
| 25 } | 27 } |
| 26 | 28 |
| 27 } // anonymous namespace | 29 } // anonymous namespace |
| 28 | 30 |
| 29 PermissionServiceImpl::PendingRequest::PendingRequest(PermissionType permission, | 31 PermissionServiceImpl::PendingRequest::PendingRequest(PermissionType permission, |
| 30 const GURL& origin) | 32 const GURL& origin) |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 116 GURL embedding_origin = context_->GetEmbeddingOrigin(); | 118 GURL embedding_origin = context_->GetEmbeddingOrigin(); |
| 117 | 119 |
| 118 callback.Run(GetContentClient()->browser()->GetPermissionStatus( | 120 callback.Run(GetContentClient()->browser()->GetPermissionStatus( |
| 119 PermissionNameToPermissionType(permission), | 121 PermissionNameToPermissionType(permission), |
| 120 context_->GetBrowserContext(), | 122 context_->GetBrowserContext(), |
| 121 GURL(origin), | 123 GURL(origin), |
| 122 embedding_origin.is_empty() ? GURL(origin) : embedding_origin)); | 124 embedding_origin.is_empty() ? GURL(origin) : embedding_origin)); |
| 123 } | 125 } |
| 124 | 126 |
| 125 } // namespace content | 127 } // namespace content |
| OLD | NEW |