| 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 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1333 void WebContentsImpl::LostMouseLock() { | 1333 void WebContentsImpl::LostMouseLock() { |
| 1334 if (delegate_) | 1334 if (delegate_) |
| 1335 delegate_->LostMouseLock(); | 1335 delegate_->LostMouseLock(); |
| 1336 } | 1336 } |
| 1337 | 1337 |
| 1338 void WebContentsImpl::CreateNewWindow( | 1338 void WebContentsImpl::CreateNewWindow( |
| 1339 int route_id, | 1339 int route_id, |
| 1340 const ViewHostMsg_CreateWindow_Params& params, | 1340 const ViewHostMsg_CreateWindow_Params& params, |
| 1341 SessionStorageNamespace* session_storage_namespace) { | 1341 SessionStorageNamespace* session_storage_namespace) { |
| 1342 if (delegate_ && !delegate_->ShouldCreateWebContents( | 1342 if (delegate_ && !delegate_->ShouldCreateWebContents( |
| 1343 this, route_id, params.window_container_type, params.frame_name, | 1343 this, |
| 1344 params.target_url)) { | 1344 route_id, |
| 1345 params.window_container_type, |
| 1346 params.frame_name, |
| 1347 params.target_url, |
| 1348 params.window_features)) { |
| 1345 GetRenderViewHost()->GetProcess()->ResumeRequestsForView(route_id); | 1349 GetRenderViewHost()->GetProcess()->ResumeRequestsForView(route_id); |
| 1346 return; | 1350 return; |
| 1347 } | 1351 } |
| 1348 | 1352 |
| 1349 // We usually create the new window in the same BrowsingInstance (group of | 1353 // We usually create the new window in the same BrowsingInstance (group of |
| 1350 // script-related windows), by passing in the current SiteInstance. However, | 1354 // script-related windows), by passing in the current SiteInstance. However, |
| 1351 // if the opener is being suppressed (in a non-guest), we create a new | 1355 // if the opener is being suppressed (in a non-guest), we create a new |
| 1352 // SiteInstance in its own BrowsingInstance. | 1356 // SiteInstance in its own BrowsingInstance. |
| 1353 bool is_guest = GetRenderProcessHost()->IsGuest(); | 1357 bool is_guest = GetRenderProcessHost()->IsGuest(); |
| 1354 | 1358 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1412 // later. | 1416 // later. |
| 1413 DCHECK_NE(MSG_ROUTING_NONE, route_id); | 1417 DCHECK_NE(MSG_ROUTING_NONE, route_id); |
| 1414 pending_contents_[route_id] = new_contents; | 1418 pending_contents_[route_id] = new_contents; |
| 1415 registrar_.Add(this, NOTIFICATION_WEB_CONTENTS_DESTROYED, | 1419 registrar_.Add(this, NOTIFICATION_WEB_CONTENTS_DESTROYED, |
| 1416 Source<WebContents>(new_contents)); | 1420 Source<WebContents>(new_contents)); |
| 1417 } | 1421 } |
| 1418 | 1422 |
| 1419 if (delegate_) { | 1423 if (delegate_) { |
| 1420 delegate_->WebContentsCreated( | 1424 delegate_->WebContentsCreated( |
| 1421 this, params.opener_frame_id, params.frame_name, | 1425 this, params.opener_frame_id, params.frame_name, |
| 1422 params.target_url, new_contents); | 1426 params.target_url, params.window_features, new_contents); |
| 1423 } | 1427 } |
| 1424 | 1428 |
| 1425 if (params.opener_suppressed) { | 1429 if (params.opener_suppressed) { |
| 1426 // When the opener is suppressed, the original renderer cannot access the | 1430 // When the opener is suppressed, the original renderer cannot access the |
| 1427 // new window. As a result, we need to show and navigate the window here. | 1431 // new window. As a result, we need to show and navigate the window here. |
| 1428 bool was_blocked = false; | 1432 bool was_blocked = false; |
| 1429 if (delegate_) { | 1433 if (delegate_) { |
| 1430 gfx::Rect initial_pos; | 1434 gfx::Rect initial_pos; |
| 1431 delegate_->AddNewContents( | 1435 delegate_->AddNewContents( |
| 1432 this, new_contents, params.disposition, initial_pos, | 1436 this, new_contents, params.disposition, initial_pos, |
| (...skipping 2024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3457 } | 3461 } |
| 3458 | 3462 |
| 3459 BrowserPluginGuestManager* | 3463 BrowserPluginGuestManager* |
| 3460 WebContentsImpl::GetBrowserPluginGuestManager() const { | 3464 WebContentsImpl::GetBrowserPluginGuestManager() const { |
| 3461 return static_cast<BrowserPluginGuestManager*>( | 3465 return static_cast<BrowserPluginGuestManager*>( |
| 3462 GetBrowserContext()->GetUserData( | 3466 GetBrowserContext()->GetUserData( |
| 3463 browser_plugin::kBrowserPluginGuestManagerKeyName)); | 3467 browser_plugin::kBrowserPluginGuestManagerKeyName)); |
| 3464 } | 3468 } |
| 3465 | 3469 |
| 3466 } // namespace content | 3470 } // namespace content |
| OLD | NEW |