OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/child/permissions/permission_dispatcher.h" | 5 #include "content/child/permissions/permission_dispatcher.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "content/child/worker_task_runner.h" | 8 #include "content/child/worker_task_runner.h" |
9 #include "content/public/common/service_registry.h" | 9 #include "content/public/common/service_registry.h" |
10 #include "third_party/WebKit/public/platform/WebURL.h" | 10 #include "third_party/WebKit/public/platform/WebURL.h" |
11 #include "third_party/WebKit/public/platform/modules/permissions/WebPermissionOb
server.h" | 11 #include "third_party/WebKit/public/platform/modules/permissions/WebPermissionOb
server.h" |
12 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" | 12 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" |
13 | 13 |
14 using blink::WebPermissionObserver; | 14 using blink::WebPermissionObserver; |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 PermissionName GetPermissionName(blink::WebPermissionType type) { | 20 PermissionName GetPermissionName(blink::WebPermissionType type) { |
21 switch (type) { | 21 switch (type) { |
22 case blink::WebPermissionTypeGeolocation: | 22 case blink::WebPermissionTypeGeolocation: |
23 return PERMISSION_NAME_GEOLOCATION; | 23 return PERMISSION_NAME_GEOLOCATION; |
24 case blink::WebPermissionTypeNotifications: | 24 case blink::WebPermissionTypeNotifications: |
25 return PERMISSION_NAME_NOTIFICATIONS; | 25 return PERMISSION_NAME_NOTIFICATIONS; |
26 case blink::WebPermissionTypePushNotifications: | 26 case blink::WebPermissionTypePushNotifications: |
27 return PERMISSION_NAME_PUSH_NOTIFICATIONS; | 27 return PERMISSION_NAME_PUSH_NOTIFICATIONS; |
28 case blink::WebPermissionTypeMidiSysEx: | 28 case blink::WebPermissionTypeMidiSysEx: |
29 return PERMISSION_NAME_MIDI_SYSEX; | 29 return PERMISSION_NAME_MIDI_SYSEX; |
| 30 case blink::WebPermissionTypeDurableStorage: |
| 31 return PERMISSION_NAME_DURABLE_STORAGE; |
30 default: | 32 default: |
31 // The default statement is only there to prevent compilation failures if | 33 // The default statement is only there to prevent compilation failures if |
32 // WebPermissionType enum gets extended. | 34 // WebPermissionType enum gets extended. |
33 NOTREACHED(); | 35 NOTREACHED(); |
34 return PERMISSION_NAME_GEOLOCATION; | 36 return PERMISSION_NAME_GEOLOCATION; |
35 } | 37 } |
36 } | 38 } |
37 | 39 |
38 PermissionStatus GetPermissionStatus(blink::WebPermissionStatus status) { | 40 PermissionStatus GetPermissionStatus(blink::WebPermissionStatus status) { |
39 switch (status) { | 41 switch (status) { |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 origin, | 351 origin, |
350 current_status, | 352 current_status, |
351 base::Bind(&PermissionDispatcher::OnPermissionChanged, | 353 base::Bind(&PermissionDispatcher::OnPermissionChanged, |
352 base::Unretained(this), | 354 base::Unretained(this), |
353 type, | 355 type, |
354 origin, | 356 origin, |
355 base::Unretained(observer))); | 357 base::Unretained(observer))); |
356 } | 358 } |
357 | 359 |
358 } // namespace content | 360 } // namespace content |
OLD | NEW |