| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |