OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1314 | 1314 |
1315 void WebContentsImpl::ShowContextMenu( | 1315 void WebContentsImpl::ShowContextMenu( |
1316 const content::ContextMenuParams& params) { | 1316 const content::ContextMenuParams& params) { |
1317 // Allow WebContentsDelegates to handle the context menu operation first. | 1317 // Allow WebContentsDelegates to handle the context menu operation first. |
1318 if (delegate_ && delegate_->HandleContextMenu(params)) | 1318 if (delegate_ && delegate_->HandleContextMenu(params)) |
1319 return; | 1319 return; |
1320 | 1320 |
1321 render_view_host_delegate_view_->ShowContextMenu(params); | 1321 render_view_host_delegate_view_->ShowContextMenu(params); |
1322 } | 1322 } |
1323 | 1323 |
| 1324 void WebContentsImpl::RequestMediaAccessPermission( |
| 1325 const content::MediaStreamRequest* request, |
| 1326 const content::MediaResponseCallback& callback) { |
| 1327 if (delegate_) |
| 1328 delegate_->RequestMediaAccessPermission(this, request, callback); |
| 1329 else |
| 1330 callback.Run(content::MediaStreamDevices()); |
| 1331 } |
| 1332 |
1324 void WebContentsImpl::UpdatePreferredSize(const gfx::Size& pref_size) { | 1333 void WebContentsImpl::UpdatePreferredSize(const gfx::Size& pref_size) { |
1325 preferred_size_ = pref_size; | 1334 preferred_size_ = pref_size; |
1326 if (delegate_) | 1335 if (delegate_) |
1327 delegate_->UpdatePreferredSize(this, pref_size); | 1336 delegate_->UpdatePreferredSize(this, pref_size); |
1328 } | 1337 } |
1329 | 1338 |
1330 void WebContentsImpl::ResizeDueToAutoResize(const gfx::Size& new_size) { | 1339 void WebContentsImpl::ResizeDueToAutoResize(const gfx::Size& new_size) { |
1331 if (delegate_) | 1340 if (delegate_) |
1332 delegate_->ResizeDueToAutoResize(this, new_size); | 1341 delegate_->ResizeDueToAutoResize(this, new_size); |
1333 } | 1342 } |
(...skipping 1695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3029 browser_plugin_host()->embedder_render_process_host(); | 3038 browser_plugin_host()->embedder_render_process_host(); |
3030 *embedder_container_id = browser_plugin_host()->instance_id(); | 3039 *embedder_container_id = browser_plugin_host()->instance_id(); |
3031 int embedder_process_id = | 3040 int embedder_process_id = |
3032 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; | 3041 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; |
3033 if (embedder_process_id != -1) { | 3042 if (embedder_process_id != -1) { |
3034 *embedder_channel_name = | 3043 *embedder_channel_name = |
3035 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), | 3044 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), |
3036 embedder_process_id); | 3045 embedder_process_id); |
3037 } | 3046 } |
3038 } | 3047 } |
OLD | NEW |