| 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 "android_webview/browser/aw_permission_manager.h" | 5 #include "android_webview/browser/aw_permission_manager.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "android_webview/browser/aw_browser_permission_request_delegate.h" | 9 #include "android_webview/browser/aw_browser_permission_request_delegate.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 pending_request->requesting_origin, | 304 pending_request->requesting_origin, |
| 305 base::Bind(&OnRequestResponse, weak_ptr_factory_.GetWeakPtr(), | 305 base::Bind(&OnRequestResponse, weak_ptr_factory_.GetWeakPtr(), |
| 306 request_id, permissions[i])); | 306 request_id, permissions[i])); |
| 307 break; | 307 break; |
| 308 case PermissionType::MIDI_SYSEX: | 308 case PermissionType::MIDI_SYSEX: |
| 309 delegate->RequestMIDISysexPermission( | 309 delegate->RequestMIDISysexPermission( |
| 310 pending_request->requesting_origin, | 310 pending_request->requesting_origin, |
| 311 base::Bind(&OnRequestResponse, weak_ptr_factory_.GetWeakPtr(), | 311 base::Bind(&OnRequestResponse, weak_ptr_factory_.GetWeakPtr(), |
| 312 request_id, permissions[i])); | 312 request_id, permissions[i])); |
| 313 break; | 313 break; |
| 314 case PermissionType::SENSORS: |
| 314 case PermissionType::AUDIO_CAPTURE: | 315 case PermissionType::AUDIO_CAPTURE: |
| 315 case PermissionType::VIDEO_CAPTURE: | 316 case PermissionType::VIDEO_CAPTURE: |
| 316 case PermissionType::NOTIFICATIONS: | 317 case PermissionType::NOTIFICATIONS: |
| 317 case PermissionType::PUSH_MESSAGING: | 318 case PermissionType::PUSH_MESSAGING: |
| 318 case PermissionType::DURABLE_STORAGE: | 319 case PermissionType::DURABLE_STORAGE: |
| 319 case PermissionType::BACKGROUND_SYNC: | 320 case PermissionType::BACKGROUND_SYNC: |
| 320 case PermissionType::FLASH: | 321 case PermissionType::FLASH: |
| 321 NOTIMPLEMENTED() << "RequestPermissions is not implemented for " | 322 NOTIMPLEMENTED() << "RequestPermissions is not implemented for " |
| 322 << static_cast<int>(permissions[i]); | 323 << static_cast<int>(permissions[i]); |
| 323 pending_request->SetPermissionStatus(permissions[i], | 324 pending_request->SetPermissionStatus(permissions[i], |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 break; | 443 break; |
| 443 case PermissionType::PROTECTED_MEDIA_IDENTIFIER: | 444 case PermissionType::PROTECTED_MEDIA_IDENTIFIER: |
| 444 if (delegate) | 445 if (delegate) |
| 445 delegate->CancelProtectedMediaIdentifierPermissionRequests( | 446 delegate->CancelProtectedMediaIdentifierPermissionRequests( |
| 446 requesting_origin); | 447 requesting_origin); |
| 447 break; | 448 break; |
| 448 case PermissionType::MIDI_SYSEX: | 449 case PermissionType::MIDI_SYSEX: |
| 449 if (delegate) | 450 if (delegate) |
| 450 delegate->CancelMIDISysexPermissionRequests(requesting_origin); | 451 delegate->CancelMIDISysexPermissionRequests(requesting_origin); |
| 451 break; | 452 break; |
| 453 case PermissionType::SENSORS: |
| 452 case PermissionType::NOTIFICATIONS: | 454 case PermissionType::NOTIFICATIONS: |
| 453 case PermissionType::PUSH_MESSAGING: | 455 case PermissionType::PUSH_MESSAGING: |
| 454 case PermissionType::DURABLE_STORAGE: | 456 case PermissionType::DURABLE_STORAGE: |
| 455 case PermissionType::AUDIO_CAPTURE: | 457 case PermissionType::AUDIO_CAPTURE: |
| 456 case PermissionType::VIDEO_CAPTURE: | 458 case PermissionType::VIDEO_CAPTURE: |
| 457 case PermissionType::BACKGROUND_SYNC: | 459 case PermissionType::BACKGROUND_SYNC: |
| 458 case PermissionType::FLASH: | 460 case PermissionType::FLASH: |
| 459 NOTIMPLEMENTED() << "CancelPermission not implemented for " | 461 NOTIMPLEMENTED() << "CancelPermission not implemented for " |
| 460 << static_cast<int>(permission); | 462 << static_cast<int>(permission); |
| 461 break; | 463 break; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 ->GetLastCommittedURL().GetOrigin(); | 544 ->GetLastCommittedURL().GetOrigin(); |
| 543 } | 545 } |
| 544 | 546 |
| 545 AwBrowserPermissionRequestDelegate* AwPermissionManager::GetDelegate( | 547 AwBrowserPermissionRequestDelegate* AwPermissionManager::GetDelegate( |
| 546 int render_process_id, int render_frame_id) { | 548 int render_process_id, int render_frame_id) { |
| 547 return AwBrowserPermissionRequestDelegate::FromID(render_process_id, | 549 return AwBrowserPermissionRequestDelegate::FromID(render_process_id, |
| 548 render_frame_id); | 550 render_frame_id); |
| 549 } | 551 } |
| 550 | 552 |
| 551 } // namespace android_webview | 553 } // namespace android_webview |
| OLD | NEW |