| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/extensions/extension_host.h" | 5 #include "chrome/browser/extensions/extension_host.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 | 641 |
| 642 void ExtensionHost::RenderViewReady() { | 642 void ExtensionHost::RenderViewReady() { |
| 643 content::NotificationService::current()->Notify( | 643 content::NotificationService::current()->Notify( |
| 644 chrome::NOTIFICATION_EXTENSION_HOST_CREATED, | 644 chrome::NOTIFICATION_EXTENSION_HOST_CREATED, |
| 645 content::Source<Profile>(profile_), | 645 content::Source<Profile>(profile_), |
| 646 content::Details<ExtensionHost>(this)); | 646 content::Details<ExtensionHost>(this)); |
| 647 } | 647 } |
| 648 | 648 |
| 649 void ExtensionHost::RequestMediaAccessPermission( | 649 void ExtensionHost::RequestMediaAccessPermission( |
| 650 content::WebContents* web_contents, | 650 content::WebContents* web_contents, |
| 651 const content::MediaStreamRequest* request, | 651 const content::MediaStreamRequest& request, |
| 652 const content::MediaResponseCallback& callback) { | 652 const content::MediaResponseCallback& callback) { |
| 653 // Get the preferred default devices for the request. | 653 // Get the preferred default devices for the request. |
| 654 content::MediaStreamDevices devices; | 654 content::MediaStreamDevices devices; |
| 655 media::GetDefaultDevicesForProfile( | 655 media::GetDefaultDevicesForProfile( |
| 656 profile_, | 656 profile_, |
| 657 content::IsAudioMediaType(request->audio_type), | 657 content::IsAudioMediaType(request.audio_type), |
| 658 content::IsVideoMediaType(request->video_type), | 658 content::IsVideoMediaType(request.video_type), |
| 659 &devices); | 659 &devices); |
| 660 | 660 |
| 661 // For tab capture device, we require the tabCapture permission. | 661 // For tab capture device, we require the tabCapture permission. |
| 662 RequestMediaAccessPermissionHelper::AuthorizeRequest( | 662 RequestMediaAccessPermissionHelper::AuthorizeRequest( |
| 663 devices, request, callback, extension(), false); | 663 devices, request, callback, extension(), false); |
| 664 } | 664 } |
| 665 | 665 |
| 666 } // namespace extensions | 666 } // namespace extensions |
| OLD | NEW |