| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "content/public/browser/browser_context.h" | 8 #include "content/public/browser/browser_context.h" |
| 9 #include "content/public/browser/permission_manager.h" | 9 #include "content/public/browser/permission_manager.h" |
| 10 #include "content/public/browser/permission_type.h" | 10 #include "content/public/browser/permission_type.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 PermissionType PermissionNameToPermissionType(PermissionName name) { | 16 PermissionType PermissionNameToPermissionType(PermissionName name) { |
| 17 switch(name) { | 17 switch(name) { |
| 18 case PERMISSION_NAME_GEOLOCATION: | 18 case PERMISSION_NAME_GEOLOCATION: |
| 19 return PermissionType::GEOLOCATION; | 19 return PermissionType::GEOLOCATION; |
| 20 case PERMISSION_NAME_NOTIFICATIONS: | 20 case PERMISSION_NAME_NOTIFICATIONS: |
| 21 return PermissionType::NOTIFICATIONS; | 21 return PermissionType::NOTIFICATIONS; |
| 22 case PERMISSION_NAME_PUSH_NOTIFICATIONS: | 22 case PERMISSION_NAME_PUSH_NOTIFICATIONS: |
| 23 return PermissionType::PUSH_MESSAGING; | 23 return PermissionType::PUSH_MESSAGING; |
| 24 case PERMISSION_NAME_MIDI: | 24 case PERMISSION_NAME_MIDI: |
| 25 return PermissionType::MIDI; | 25 return PermissionType::MIDI; |
| 26 case PERMISSION_NAME_MIDI_SYSEX: | 26 case PERMISSION_NAME_MIDI_SYSEX: |
| 27 return PermissionType::MIDI_SYSEX; | 27 return PermissionType::MIDI_SYSEX; |
| 28 case PERMISSION_NAME_PROTECTED_MEDIA_IDENTIFIER: | 28 case PERMISSION_NAME_PROTECTED_MEDIA_IDENTIFIER: |
| 29 return PermissionType::PROTECTED_MEDIA_IDENTIFIER; | 29 return PermissionType::PROTECTED_MEDIA_IDENTIFIER; |
| 30 case PERMISSION_NAME_DURABLE_STORAGE: |
| 31 return PermissionType::DURABLE_STORAGE; |
| 30 } | 32 } |
| 31 | 33 |
| 32 NOTREACHED(); | 34 NOTREACHED(); |
| 33 return PermissionType::NUM; | 35 return PermissionType::NUM; |
| 34 } | 36 } |
| 35 | 37 |
| 36 } // anonymous namespace | 38 } // anonymous namespace |
| 37 | 39 |
| 38 PermissionServiceImpl::PendingRequest::PendingRequest( | 40 PermissionServiceImpl::PendingRequest::PendingRequest( |
| 39 PermissionType permission, | 41 PermissionType permission, |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 | 285 |
| 284 PermissionStatusCallback callback = subscription->callback; | 286 PermissionStatusCallback callback = subscription->callback; |
| 285 | 287 |
| 286 subscription->callback.reset(); | 288 subscription->callback.reset(); |
| 287 pending_subscriptions_.Remove(pending_subscription_id); | 289 pending_subscriptions_.Remove(pending_subscription_id); |
| 288 | 290 |
| 289 callback.Run(status); | 291 callback.Run(status); |
| 290 } | 292 } |
| 291 | 293 |
| 292 } // namespace content | 294 } // namespace content |
| OLD | NEW |