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

Unified Diff: extensions/shell/browser/shell_app_window.cc

Issue 493453004: app_shell: Add audio and video capture support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: (video-capture) audio and video work Created 6 years, 4 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: extensions/shell/browser/shell_app_window.cc
diff --git a/extensions/shell/browser/shell_app_window.cc b/extensions/shell/browser/shell_app_window.cc
index a66554ea1ca03f7e7b7292684f9fc5984e334fdb..847ddf08d7f27b423a1448bd40c5b5f551f12f77 100644
--- a/extensions/shell/browser/shell_app_window.cc
+++ b/extensions/shell/browser/shell_app_window.cc
@@ -9,6 +9,7 @@
#include "content/public/browser/web_contents.h"
#include "extensions/browser/view_type_utils.h"
#include "extensions/common/extension_messages.h"
+#include "extensions/shell/browser/media_capture_util.h"
#include "extensions/shell/browser/shell_extension_web_contents_observer.h"
#include "ipc/ipc_message_macros.h"
@@ -33,6 +34,7 @@ void ShellAppWindow::Init(BrowserContext* context, gfx::Size initial_size) {
web_contents_.reset(WebContents::Create(create_params));
content::WebContentsObserver::Observe(web_contents_.get());
+ web_contents_->SetDelegate(this);
// Add support for extension startup.
ShellExtensionWebContentsObserver::CreateForWebContents(web_contents_.get());
@@ -54,6 +56,15 @@ int ShellAppWindow::GetRenderViewRoutingID() {
return web_contents_->GetRenderViewHost()->GetRoutingID();
}
+void ShellAppWindow::RequestMediaAccessPermission(
+ content::WebContents* web_contents,
+ const content::MediaStreamRequest& request,
+ const content::MediaResponseCallback& callback) {
+ // Allow access to the first microphone and/or camera.
+ media_capture_util::GrantMediaStreamRequestWithFirstDevice(
+ web_contents, request, callback);
+}
+
bool ShellAppWindow::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(ShellAppWindow, message)

Powered by Google App Engine
This is Rietveld 408576698