| 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 #ifndef CHROME_BROWSER_MEDIA_WEBRTC_DESKTOP_CAPTURE_ACCESS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_WEBRTC_DESKTOP_CAPTURE_ACCESS_HANDLER_H_ |
| 6 #define CHROME_BROWSER_MEDIA_WEBRTC_DESKTOP_CAPTURE_ACCESS_HANDLER_H_ | 6 #define CHROME_BROWSER_MEDIA_WEBRTC_DESKTOP_CAPTURE_ACCESS_HANDLER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "chrome/browser/media/capture_access_handler_base.h" | 10 #include "chrome/browser/media/capture_access_handler_base.h" |
| 11 #include "chrome/browser/media/media_access_handler.h" | 11 #include "chrome/browser/media/media_access_handler.h" |
| 12 | 12 |
| 13 namespace extensions { |
| 14 class Extension; |
| 15 } |
| 16 |
| 13 // MediaAccessHandler for DesktopCapture API. | 17 // MediaAccessHandler for DesktopCapture API. |
| 14 class DesktopCaptureAccessHandler : public CaptureAccessHandlerBase { | 18 class DesktopCaptureAccessHandler : public CaptureAccessHandlerBase { |
| 15 public: | 19 public: |
| 16 DesktopCaptureAccessHandler(); | 20 DesktopCaptureAccessHandler(); |
| 17 ~DesktopCaptureAccessHandler() override; | 21 ~DesktopCaptureAccessHandler() override; |
| 18 | 22 |
| 19 // MediaAccessHandler implementation. | 23 // MediaAccessHandler implementation. |
| 20 bool SupportsStreamType(const content::MediaStreamType type, | 24 bool SupportsStreamType(const content::MediaStreamType type, |
| 21 const extensions::Extension* extension) override; | 25 const extensions::Extension* extension) override; |
| 22 bool CheckMediaAccessPermission( | 26 bool CheckMediaAccessPermission( |
| 23 content::WebContents* web_contents, | 27 content::WebContents* web_contents, |
| 24 const GURL& security_origin, | 28 const GURL& security_origin, |
| 25 content::MediaStreamType type, | 29 content::MediaStreamType type, |
| 26 const extensions::Extension* extension) override; | 30 const extensions::Extension* extension) override; |
| 27 void HandleRequest(content::WebContents* web_contents, | 31 void HandleRequest(content::WebContents* web_contents, |
| 28 const content::MediaStreamRequest& request, | 32 const content::MediaStreamRequest& request, |
| 29 const content::MediaResponseCallback& callback, | 33 const content::MediaResponseCallback& callback, |
| 30 const extensions::Extension* extension) override; | 34 const extensions::Extension* extension) override; |
| 31 | 35 |
| 32 private: | 36 private: |
| 33 void ProcessScreenCaptureAccessRequest( | 37 void ProcessScreenCaptureAccessRequest( |
| 34 content::WebContents* web_contents, | 38 content::WebContents* web_contents, |
| 35 const content::MediaStreamRequest& request, | 39 const content::MediaStreamRequest& request, |
| 36 const content::MediaResponseCallback& callback, | 40 const content::MediaResponseCallback& callback, |
| 37 const extensions::Extension* extension); | 41 const extensions::Extension* extension); |
| 38 | 42 |
| 43 // Returns whether desktop capture is always approved for |extension|. |
| 44 // Currently component extensions and some whitelisted extensions are default |
| 45 // approved. |
| 46 static bool IsDefaultApproved(const extensions::Extension* extension); |
| 39 }; | 47 }; |
| 40 | 48 |
| 41 #endif // CHROME_BROWSER_MEDIA_WEBRTC_DESKTOP_CAPTURE_ACCESS_HANDLER_H_ | 49 #endif // CHROME_BROWSER_MEDIA_WEBRTC_DESKTOP_CAPTURE_ACCESS_HANDLER_H_ |
| OLD | NEW |