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

Unified Diff: chrome/browser/media/media_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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/media_access_handler.h
diff --git a/chrome/browser/media/media_access_handler.h b/chrome/browser/media/media_access_handler.h
index bc7b8556380abbca69baa61a9b6ccb60b423bb22..82dc719502e2b419cf25a348fbb0f4135b5fb7cb 100644
--- a/chrome/browser/media/media_access_handler.h
+++ b/chrome/browser/media/media_access_handler.h
@@ -25,7 +25,8 @@ class MediaAccessHandler {
virtual ~MediaAccessHandler() {}
// Check if the media stream type is supported by MediaAccessHandler.
- virtual bool SupportsStreamType(const content::MediaStreamType type,
+ virtual bool SupportsStreamType(content::WebContents* web_contents,
+ const content::MediaStreamType type,
const extensions::Extension* extension) = 0;
// Check media access permission. |extension| is set to NULL if request was
// made from a drive-by page.
@@ -46,6 +47,17 @@ class MediaAccessHandler {
int page_request_id,
content::MediaStreamType stream_type,
content::MediaRequestState state) {}
+
+ protected:
+ // Helper function for derived classes which takes in whether audio/video
+ // permissions are allowed and queries for the requested devices, running the
+ // callback with the appropriate device list and status.
+ static void CheckDevicesAndRunCallback(
+ content::WebContents* web_contents,
+ const content::MediaStreamRequest& request,
+ const content::MediaResponseCallback& callback,
+ bool audio_allowed,
+ bool video_allowed);
};
#endif // CHROME_BROWSER_MEDIA_MEDIA_ACCESS_HANDLER_H_
« no previous file with comments | « chrome/browser/media/extension_media_access_handler.cc ('k') | chrome/browser/media/media_access_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698