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 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1387 } | 1387 } |
1388 | 1388 |
1389 void WebContentsImpl::CreateNewWidget(int route_id, | 1389 void WebContentsImpl::CreateNewWidget(int route_id, |
1390 bool is_fullscreen, | 1390 bool is_fullscreen, |
1391 WebKit::WebPopupType popup_type) { | 1391 WebKit::WebPopupType popup_type) { |
1392 RenderProcessHost* process = GetRenderProcessHost(); | 1392 RenderProcessHost* process = GetRenderProcessHost(); |
1393 RenderWidgetHostImpl* widget_host = | 1393 RenderWidgetHostImpl* widget_host = |
1394 new RenderWidgetHostImpl(this, process, route_id); | 1394 new RenderWidgetHostImpl(this, process, route_id); |
1395 created_widgets_.insert(widget_host); | 1395 created_widgets_.insert(widget_host); |
1396 | 1396 |
1397 RenderWidgetHostViewPort* widget_view = | 1397 RenderWidgetHostViewPort* widget_view = RenderWidgetHostViewPort::FromRWHV( |
1398 RenderWidgetHostViewPort::CreateViewForWidget(widget_host); | 1398 view_->CreateViewForPopupWidget(widget_host)); |
| 1399 if (!widget_view) |
| 1400 return; |
1399 if (!is_fullscreen) { | 1401 if (!is_fullscreen) { |
1400 // Popups should not get activated. | 1402 // Popups should not get activated. |
1401 widget_view->SetPopupType(popup_type); | 1403 widget_view->SetPopupType(popup_type); |
1402 } | 1404 } |
1403 // Save the created widget associated with the route so we can show it later. | 1405 // Save the created widget associated with the route so we can show it later. |
1404 pending_widget_views_[route_id] = widget_view; | 1406 pending_widget_views_[route_id] = widget_view; |
1405 | 1407 |
1406 #if defined(OS_MACOSX) | 1408 #if defined(OS_MACOSX) |
1407 // A RenderWidgetHostViewMac has lifetime scoped to the view. We'll retain it | 1409 // A RenderWidgetHostViewMac has lifetime scoped to the view. We'll retain it |
1408 // to allow it to survive the trip without being hosted. | 1410 // to allow it to survive the trip without being hosted. |
(...skipping 1980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3389 | 3391 |
3390 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { | 3392 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { |
3391 return browser_plugin_guest_.get(); | 3393 return browser_plugin_guest_.get(); |
3392 } | 3394 } |
3393 | 3395 |
3394 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { | 3396 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { |
3395 return browser_plugin_embedder_.get(); | 3397 return browser_plugin_embedder_.get(); |
3396 } | 3398 } |
3397 | 3399 |
3398 } // namespace content | 3400 } // namespace content |
OLD | NEW |