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

Unified Diff: content/public/browser/web_contents_delegate.h

Issue 10542092: Refactor the content interface for RequestMediaAccessPermission. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 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
« no previous file with comments | « content/public/browser/content_browser_client.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/web_contents_delegate.h
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
index 6c3b6f8198fcc99e88a8ed31b310be0b455b44ff..5fc03dae9570d2033e997fb83af663670b2f5e52 100644
--- a/content/public/browser/web_contents_delegate.h
+++ b/content/public/browser/web_contents_delegate.h
@@ -10,9 +10,11 @@
#include <string>
#include "base/basictypes.h"
+#include "base/callback.h"
#include "base/string16.h"
#include "content/common/content_export.h"
#include "content/public/browser/navigation_type.h"
+#include "content/public/common/media_stream_request.h"
#include "content/public/common/page_transition_types.h"
#include "content/public/common/window_container_type.h"
#include "third_party/skia/include/core/SkColor.h"
@@ -60,6 +62,8 @@ namespace content {
struct OpenURLParams;
+typedef base::Callback< void(const MediaStreamDevices&) > MediaResponseCallback;
+
// Objects implement this interface to get notified about changes in the
// WebContents and to provide necessary functionality.
class CONTENT_EXPORT WebContentsDelegate {
@@ -407,12 +411,21 @@ class CONTENT_EXPORT WebContentsDelegate {
// contents.
virtual void RequestToLockMouse(WebContents* web_contents,
bool user_gesture,
- bool last_unlocked_by_target) {
- }
+ bool last_unlocked_by_target) {}
// Notification that the page has lost the mouse lock.
virtual void LostMouseLock() {}
+ // Asks permission to use the camera and/or microphone. If permission is
+ // granted, a call should be made to |callback| with the devices. If the
+ // request is denied, a call should be made to |callback| with an empty list
+ // of devices. |request| has the details of the request (e.g. which of audio
+ // and/or video devices are requested, and lists of available devices).
+ virtual void RequestMediaAccessPermission(
+ WebContents* web_contents,
+ const MediaStreamRequest* request,
+ const MediaResponseCallback& callback) {}
+
protected:
virtual ~WebContentsDelegate();
« no previous file with comments | « content/public/browser/content_browser_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698