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_SYSEX: | 24 case PERMISSION_NAME_MIDI_SYSEX: |
25 return PermissionType::MIDI_SYSEX; | 25 return PermissionType::MIDI_SYSEX; |
26 case PERMISSION_NAME_PROTECTED_MEDIA_IDENTIFIER: | 26 case PERMISSION_NAME_PROTECTED_MEDIA_IDENTIFIER: |
27 return PermissionType::PROTECTED_MEDIA_IDENTIFIER; | 27 return PermissionType::PROTECTED_MEDIA_IDENTIFIER; |
| 28 case PERMISSION_NAME_DURABLE_STORAGE: |
| 29 return PermissionType::DURABLE_STORAGE; |
28 } | 30 } |
29 | 31 |
30 NOTREACHED(); | 32 NOTREACHED(); |
31 return PermissionType::NUM; | 33 return PermissionType::NUM; |
32 } | 34 } |
33 | 35 |
34 } // anonymous namespace | 36 } // anonymous namespace |
35 | 37 |
36 PermissionServiceImpl::PendingRequest::PendingRequest( | 38 PermissionServiceImpl::PendingRequest::PendingRequest( |
37 PermissionType permission, | 39 PermissionType permission, |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 | 283 |
282 PermissionStatusCallback callback = subscription->callback; | 284 PermissionStatusCallback callback = subscription->callback; |
283 | 285 |
284 subscription->callback.reset(); | 286 subscription->callback.reset(); |
285 pending_subscriptions_.Remove(pending_subscription_id); | 287 pending_subscriptions_.Remove(pending_subscription_id); |
286 | 288 |
287 callback.Run(status); | 289 callback.Run(status); |
288 } | 290 } |
289 | 291 |
290 } // namespace content | 292 } // namespace content |
OLD | NEW |