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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1298 create_params.main_frame_routing_id = main_frame_route_id; | 1298 create_params.main_frame_routing_id = main_frame_route_id; |
1299 if (!is_guest) { | 1299 if (!is_guest) { |
1300 create_params.context = view_->GetNativeView(); | 1300 create_params.context = view_->GetNativeView(); |
1301 create_params.initial_size = view_->GetContainerSize(); | 1301 create_params.initial_size = view_->GetContainerSize(); |
1302 } else { | 1302 } else { |
1303 // This makes |new_contents| act as a guest. | 1303 // This makes |new_contents| act as a guest. |
1304 // For more info, see comment above class BrowserPluginGuest. | 1304 // For more info, see comment above class BrowserPluginGuest. |
1305 int instance_id = GetBrowserPluginGuestManager()->get_next_instance_id(); | 1305 int instance_id = GetBrowserPluginGuestManager()->get_next_instance_id(); |
1306 WebContentsImpl* new_contents_impl = | 1306 WebContentsImpl* new_contents_impl = |
1307 static_cast<WebContentsImpl*>(new_contents); | 1307 static_cast<WebContentsImpl*>(new_contents); |
1308 BrowserPluginGuest::CreateWithOpener(instance_id, new_contents_impl, | 1308 BrowserPluginGuest::CreateWithOpener(instance_id, |
1309 GetBrowserPluginGuest(), !!new_contents_impl->opener()); | 1309 !!new_contents_impl->opener(), |
smo
2013/11/13 01:50:54
(optional)
I'd either stick with the existing sty
lazyboy
2013/11/13 02:07:29
Changed to != NULL
| |
1310 new_contents_impl, | |
1311 GetBrowserPluginGuest()); | |
1310 } | 1312 } |
1311 if (params.disposition == NEW_BACKGROUND_TAB) | 1313 if (params.disposition == NEW_BACKGROUND_TAB) |
1312 create_params.initially_hidden = true; | 1314 create_params.initially_hidden = true; |
1313 new_contents->Init(create_params); | 1315 new_contents->Init(create_params); |
1314 | 1316 |
1315 // Save the window for later if we're not suppressing the opener (since it | 1317 // Save the window for later if we're not suppressing the opener (since it |
1316 // will be shown immediately). | 1318 // will be shown immediately). |
1317 if (!params.opener_suppressed) { | 1319 if (!params.opener_suppressed) { |
1318 if (!is_guest) { | 1320 if (!is_guest) { |
1319 WebContentsViewPort* new_view = new_contents->view_.get(); | 1321 WebContentsViewPort* new_view = new_contents->view_.get(); |
(...skipping 2349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3669 } | 3671 } |
3670 | 3672 |
3671 void WebContentsImpl::OnFrameRemoved( | 3673 void WebContentsImpl::OnFrameRemoved( |
3672 RenderViewHostImpl* render_view_host, | 3674 RenderViewHostImpl* render_view_host, |
3673 int64 frame_id) { | 3675 int64 frame_id) { |
3674 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 3676 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
3675 FrameDetached(render_view_host, frame_id)); | 3677 FrameDetached(render_view_host, frame_id)); |
3676 } | 3678 } |
3677 | 3679 |
3678 } // namespace content | 3680 } // namespace content |
OLD | NEW |