Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Side by Side Diff: chrome/browser/media/public_session_tab_capture_access_handler.h

Issue 2746873004: Move ChromeOS login media access logic into a MediaAccessHandler (Closed)
Patch Set: Move ChromeOS login media access logic into a MediaAccessHandler Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_PUBLIC_SESSION_TAB_CAPTURE_ACCESS_HANDLER_H_ 5 #ifndef CHROME_BROWSER_MEDIA_PUBLIC_SESSION_TAB_CAPTURE_ACCESS_HANDLER_H_
6 #define CHROME_BROWSER_MEDIA_PUBLIC_SESSION_TAB_CAPTURE_ACCESS_HANDLER_H_ 6 #define CHROME_BROWSER_MEDIA_PUBLIC_SESSION_TAB_CAPTURE_ACCESS_HANDLER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "chrome/browser/extensions/extension_install_prompt.h" 9 #include "chrome/browser/extensions/extension_install_prompt.h"
10 #include "chrome/browser/media/capture_access_handler_base.h" 10 #include "chrome/browser/media/capture_access_handler_base.h"
(...skipping 12 matching lines...) Expand all
23 // extensions. This is not acceptable from a security/privacy standpoint, so 23 // extensions. This is not acceptable from a security/privacy standpoint, so
24 // when an extension uses the TabCapture API for the first time, we show the 24 // when an extension uses the TabCapture API for the first time, we show the
25 // user a dialog where they can choose whether to allow the extension access to 25 // user a dialog where they can choose whether to allow the extension access to
26 // the API. 26 // the API.
27 class PublicSessionTabCaptureAccessHandler : public CaptureAccessHandlerBase { 27 class PublicSessionTabCaptureAccessHandler : public CaptureAccessHandlerBase {
28 public: 28 public:
29 PublicSessionTabCaptureAccessHandler(); 29 PublicSessionTabCaptureAccessHandler();
30 ~PublicSessionTabCaptureAccessHandler() override; 30 ~PublicSessionTabCaptureAccessHandler() override;
31 31
32 // MediaAccessHandler implementation. 32 // MediaAccessHandler implementation.
33 bool SupportsStreamType(const content::MediaStreamType type, 33 bool SupportsStreamType(content::WebContents* web_contents,
34 const content::MediaStreamType type,
34 const extensions::Extension* extension) override; 35 const extensions::Extension* extension) override;
35 bool CheckMediaAccessPermission( 36 bool CheckMediaAccessPermission(
36 content::WebContents* web_contents, 37 content::WebContents* web_contents,
37 const GURL& security_origin, 38 const GURL& security_origin,
38 content::MediaStreamType type, 39 content::MediaStreamType type,
39 const extensions::Extension* extension) override; 40 const extensions::Extension* extension) override;
40 void HandleRequest(content::WebContents* web_contents, 41 void HandleRequest(content::WebContents* web_contents,
41 const content::MediaStreamRequest& request, 42 const content::MediaStreamRequest& request,
42 const content::MediaResponseCallback& callback, 43 const content::MediaResponseCallback& callback,
43 const extensions::Extension* extension) override; 44 const extensions::Extension* extension) override;
44 45
45 private: 46 private:
46 // Helper function used to chain the HandleRequest call into the original 47 // Helper function used to chain the HandleRequest call into the original
47 // inside of TabCaptureAccessHandler. 48 // inside of TabCaptureAccessHandler.
48 void ChainHandleRequest( 49 void ChainHandleRequest(
49 content::WebContents* web_contents, 50 content::WebContents* web_contents,
50 const content::MediaStreamRequest& request, 51 const content::MediaStreamRequest& request,
51 const content::MediaResponseCallback& callback, 52 const content::MediaResponseCallback& callback,
52 const extensions::Extension* extension, 53 const extensions::Extension* extension,
53 const extensions::PermissionIDSet& allowed_permissions); 54 const extensions::PermissionIDSet& allowed_permissions);
54 55
55 TabCaptureAccessHandler tab_capture_access_handler_; 56 TabCaptureAccessHandler tab_capture_access_handler_;
56 57
57 DISALLOW_COPY_AND_ASSIGN(PublicSessionTabCaptureAccessHandler); 58 DISALLOW_COPY_AND_ASSIGN(PublicSessionTabCaptureAccessHandler);
58 }; 59 };
59 60
60 #endif // CHROME_BROWSER_MEDIA_PUBLIC_SESSION_TAB_CAPTURE_ACCESS_HANDLER_H_ 61 #endif // CHROME_BROWSER_MEDIA_PUBLIC_SESSION_TAB_CAPTURE_ACCESS_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698