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

Side by Side Diff: extensions/shell/browser/shell_app_window.cc

Issue 514463002: app_shell: Allow getUserMedia to select a capture device by id (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "extensions/shell/browser/shell_app_window.h" 5 #include "extensions/shell/browser/shell_app_window.h"
6 6
7 #include "content/public/browser/navigation_controller.h" 7 #include "content/public/browser/navigation_controller.h"
8 #include "content/public/browser/render_view_host.h" 8 #include "content/public/browser/render_view_host.h"
9 #include "content/public/browser/web_contents.h" 9 #include "content/public/browser/web_contents.h"
10 #include "extensions/browser/view_type_utils.h" 10 #include "extensions/browser/view_type_utils.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 } 58 }
59 59
60 int ShellAppWindow::GetRenderViewRoutingID() { 60 int ShellAppWindow::GetRenderViewRoutingID() {
61 return web_contents_->GetRenderViewHost()->GetRoutingID(); 61 return web_contents_->GetRenderViewHost()->GetRoutingID();
62 } 62 }
63 63
64 void ShellAppWindow::RequestMediaAccessPermission( 64 void ShellAppWindow::RequestMediaAccessPermission(
65 content::WebContents* web_contents, 65 content::WebContents* web_contents,
66 const content::MediaStreamRequest& request, 66 const content::MediaStreamRequest& request,
67 const content::MediaResponseCallback& callback) { 67 const content::MediaResponseCallback& callback) {
68 // Allow access to the first microphone and/or camera. 68 // Allow access to the microphone and/or camera.
69 media_capture_util::GrantMediaStreamRequestWithFirstDevice( 69 media_capture_util::GrantMediaStreamRequest(
70 web_contents, request, callback, extension_); 70 web_contents, request, callback, extension_);
71 } 71 }
72 72
73 bool ShellAppWindow::OnMessageReceived(const IPC::Message& message) { 73 bool ShellAppWindow::OnMessageReceived(const IPC::Message& message) {
74 bool handled = true; 74 bool handled = true;
75 IPC_BEGIN_MESSAGE_MAP(ShellAppWindow, message) 75 IPC_BEGIN_MESSAGE_MAP(ShellAppWindow, message)
76 IPC_MESSAGE_HANDLER(ExtensionHostMsg_Request, OnRequest) 76 IPC_MESSAGE_HANDLER(ExtensionHostMsg_Request, OnRequest)
77 IPC_MESSAGE_UNHANDLED(handled = false) 77 IPC_MESSAGE_UNHANDLED(handled = false)
78 IPC_END_MESSAGE_MAP() 78 IPC_END_MESSAGE_MAP()
79 return handled; 79 return handled;
80 } 80 }
81 81
82 content::WebContents* ShellAppWindow::GetAssociatedWebContents() const { 82 content::WebContents* ShellAppWindow::GetAssociatedWebContents() const {
83 return web_contents_.get(); 83 return web_contents_.get();
84 } 84 }
85 85
86 void ShellAppWindow::OnRequest(const ExtensionHostMsg_Request_Params& params) { 86 void ShellAppWindow::OnRequest(const ExtensionHostMsg_Request_Params& params) {
87 extension_function_dispatcher_->Dispatch(params, 87 extension_function_dispatcher_->Dispatch(params,
88 web_contents_->GetRenderViewHost()); 88 web_contents_->GetRenderViewHost());
89 } 89 }
90 90
91 } // namespace extensions 91 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/shell/browser/media_capture_util.cc ('k') | extensions/shell/browser/shell_extension_host_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698