Chromium Code Reviews| 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 <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 317 pending_request_raw->requesting_origin, | 317 pending_request_raw->requesting_origin, |
| 318 base::Bind(&OnRequestResponse, weak_ptr_factory_.GetWeakPtr(), | 318 base::Bind(&OnRequestResponse, weak_ptr_factory_.GetWeakPtr(), |
| 319 request_id, permissions[i])); | 319 request_id, permissions[i])); |
| 320 break; | 320 break; |
| 321 case PermissionType::AUDIO_CAPTURE: | 321 case PermissionType::AUDIO_CAPTURE: |
| 322 case PermissionType::VIDEO_CAPTURE: | 322 case PermissionType::VIDEO_CAPTURE: |
| 323 case PermissionType::NOTIFICATIONS: | 323 case PermissionType::NOTIFICATIONS: |
| 324 case PermissionType::PUSH_MESSAGING: | 324 case PermissionType::PUSH_MESSAGING: |
| 325 case PermissionType::DURABLE_STORAGE: | 325 case PermissionType::DURABLE_STORAGE: |
| 326 case PermissionType::BACKGROUND_SYNC: | 326 case PermissionType::BACKGROUND_SYNC: |
| 327 case PermissionType::AMBIENT_LIGHT_SENSOR: | |
| 328 case PermissionType::ACCELEROMETER: | |
| 329 case PermissionType::GYROSCOPE: | |
| 330 case PermissionType::MAGNETOMETER: | |
| 331 case PermissionType::ORIENTATION_SENSOR: | |
|
timvolodine
2017/04/03 16:57:17
Is this a good name / should it be here? While the
| |
| 327 case PermissionType::FLASH: | 332 case PermissionType::FLASH: |
| 328 NOTIMPLEMENTED() << "RequestPermissions is not implemented for " | 333 NOTIMPLEMENTED() << "RequestPermissions is not implemented for " |
| 329 << static_cast<int>(permissions[i]); | 334 << static_cast<int>(permissions[i]); |
| 330 pending_request_raw->SetPermissionStatus(permissions[i], | 335 pending_request_raw->SetPermissionStatus(permissions[i], |
| 331 PermissionStatus::DENIED); | 336 PermissionStatus::DENIED); |
| 332 break; | 337 break; |
| 333 case PermissionType::MIDI: | 338 case PermissionType::MIDI: |
| 334 pending_request_raw->SetPermissionStatus(permissions[i], | 339 pending_request_raw->SetPermissionStatus(permissions[i], |
| 335 PermissionStatus::GRANTED); | 340 PermissionStatus::GRANTED); |
| 336 break; | 341 break; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 455 case PermissionType::MIDI_SYSEX: | 460 case PermissionType::MIDI_SYSEX: |
| 456 if (delegate) | 461 if (delegate) |
| 457 delegate->CancelMIDISysexPermissionRequests(requesting_origin); | 462 delegate->CancelMIDISysexPermissionRequests(requesting_origin); |
| 458 break; | 463 break; |
| 459 case PermissionType::NOTIFICATIONS: | 464 case PermissionType::NOTIFICATIONS: |
| 460 case PermissionType::PUSH_MESSAGING: | 465 case PermissionType::PUSH_MESSAGING: |
| 461 case PermissionType::DURABLE_STORAGE: | 466 case PermissionType::DURABLE_STORAGE: |
| 462 case PermissionType::AUDIO_CAPTURE: | 467 case PermissionType::AUDIO_CAPTURE: |
| 463 case PermissionType::VIDEO_CAPTURE: | 468 case PermissionType::VIDEO_CAPTURE: |
| 464 case PermissionType::BACKGROUND_SYNC: | 469 case PermissionType::BACKGROUND_SYNC: |
| 470 case PermissionType::AMBIENT_LIGHT_SENSOR: | |
| 471 case PermissionType::ACCELEROMETER: | |
| 472 case PermissionType::GYROSCOPE: | |
| 473 case PermissionType::MAGNETOMETER: | |
| 474 case PermissionType::ORIENTATION_SENSOR: | |
| 465 case PermissionType::FLASH: | 475 case PermissionType::FLASH: |
| 466 NOTIMPLEMENTED() << "CancelPermission not implemented for " | 476 NOTIMPLEMENTED() << "CancelPermission not implemented for " |
| 467 << static_cast<int>(permission); | 477 << static_cast<int>(permission); |
| 468 break; | 478 break; |
| 469 case PermissionType::MIDI: | 479 case PermissionType::MIDI: |
| 470 // There is nothing to cancel so this is simply ignored. | 480 // There is nothing to cancel so this is simply ignored. |
| 471 break; | 481 break; |
| 472 case PermissionType::NUM: | 482 case PermissionType::NUM: |
| 473 NOTREACHED() << "PermissionType::NUM was not expected here."; | 483 NOTREACHED() << "PermissionType::NUM was not expected here."; |
| 474 break; | 484 break; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 543 ->GetLastCommittedURL().GetOrigin(); | 553 ->GetLastCommittedURL().GetOrigin(); |
| 544 } | 554 } |
| 545 | 555 |
| 546 AwBrowserPermissionRequestDelegate* AwPermissionManager::GetDelegate( | 556 AwBrowserPermissionRequestDelegate* AwPermissionManager::GetDelegate( |
| 547 int render_process_id, int render_frame_id) { | 557 int render_process_id, int render_frame_id) { |
| 548 return AwBrowserPermissionRequestDelegate::FromID(render_process_id, | 558 return AwBrowserPermissionRequestDelegate::FromID(render_process_id, |
| 549 render_frame_id); | 559 render_frame_id); |
| 550 } | 560 } |
| 551 | 561 |
| 552 } // namespace android_webview | 562 } // namespace android_webview |
| OLD | NEW |