| 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 case blink::WebPermissionTypeMidi: | 32 case blink::WebPermissionTypeMidi: |
| 31 return PERMISSION_NAME_MIDI; | 33 return PERMISSION_NAME_MIDI; |
| 32 default: | 34 default: |
| 33 // The default statement is only there to prevent compilation failures if | 35 // The default statement is only there to prevent compilation failures if |
| 34 // WebPermissionType enum gets extended. | 36 // WebPermissionType enum gets extended. |
| 35 NOTREACHED(); | 37 NOTREACHED(); |
| 36 return PERMISSION_NAME_GEOLOCATION; | 38 return PERMISSION_NAME_GEOLOCATION; |
| 37 } | 39 } |
| 38 } | 40 } |
| 39 | 41 |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 origin, | 353 origin, |
| 352 current_status, | 354 current_status, |
| 353 base::Bind(&PermissionDispatcher::OnPermissionChanged, | 355 base::Bind(&PermissionDispatcher::OnPermissionChanged, |
| 354 base::Unretained(this), | 356 base::Unretained(this), |
| 355 type, | 357 type, |
| 356 origin, | 358 origin, |
| 357 base::Unretained(observer))); | 359 base::Unretained(observer))); |
| 358 } | 360 } |
| 359 | 361 |
| 360 } // namespace content | 362 } // namespace content |
| OLD | NEW |