OLD | NEW |
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 microphone and/or camera. | 68 // Allow access to the microphone and/or camera. |
69 media_capture_util::GrantMediaStreamRequest( | 69 media_capture_util::GrantMediaStreamRequest( |
70 web_contents, request, callback, extension_); | 70 web_contents, request, callback, extension_); |
71 } | 71 } |
72 | 72 |
| 73 bool ShellAppWindow::CheckMediaAccessPermission( |
| 74 content::WebContents* web_contents, |
| 75 const GURL& security_origin, |
| 76 content::MediaStreamType type) { |
| 77 media_capture_util::VerifyMediaAccessPermission(type, extension_); |
| 78 return true; |
| 79 } |
| 80 |
73 bool ShellAppWindow::OnMessageReceived(const IPC::Message& message) { | 81 bool ShellAppWindow::OnMessageReceived(const IPC::Message& message) { |
74 bool handled = true; | 82 bool handled = true; |
75 IPC_BEGIN_MESSAGE_MAP(ShellAppWindow, message) | 83 IPC_BEGIN_MESSAGE_MAP(ShellAppWindow, message) |
76 IPC_MESSAGE_HANDLER(ExtensionHostMsg_Request, OnRequest) | 84 IPC_MESSAGE_HANDLER(ExtensionHostMsg_Request, OnRequest) |
77 IPC_MESSAGE_UNHANDLED(handled = false) | 85 IPC_MESSAGE_UNHANDLED(handled = false) |
78 IPC_END_MESSAGE_MAP() | 86 IPC_END_MESSAGE_MAP() |
79 return handled; | 87 return handled; |
80 } | 88 } |
81 | 89 |
82 content::WebContents* ShellAppWindow::GetAssociatedWebContents() const { | 90 content::WebContents* ShellAppWindow::GetAssociatedWebContents() const { |
83 return web_contents_.get(); | 91 return web_contents_.get(); |
84 } | 92 } |
85 | 93 |
86 void ShellAppWindow::OnRequest(const ExtensionHostMsg_Request_Params& params) { | 94 void ShellAppWindow::OnRequest(const ExtensionHostMsg_Request_Params& params) { |
87 extension_function_dispatcher_->Dispatch(params, | 95 extension_function_dispatcher_->Dispatch(params, |
88 web_contents_->GetRenderViewHost()); | 96 web_contents_->GetRenderViewHost()); |
89 } | 97 } |
90 | 98 |
91 } // namespace extensions | 99 } // namespace extensions |
OLD | NEW |