| 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/browser_plugin/browser_plugin_guest.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 new_target_url.changed = new_target_url.url != old_target_url.url; | 446 new_target_url.changed = new_target_url.url != old_target_url.url; |
| 447 it->second = new_target_url; | 447 it->second = new_target_url; |
| 448 return NULL; | 448 return NULL; |
| 449 } | 449 } |
| 450 // This can happen for cross-site redirects. | 450 // This can happen for cross-site redirects. |
| 451 source->GetController().LoadURL( | 451 source->GetController().LoadURL( |
| 452 params.url, params.referrer, params.transition, std::string()); | 452 params.url, params.referrer, params.transition, std::string()); |
| 453 return source; | 453 return source; |
| 454 } | 454 } |
| 455 | 455 |
| 456 void BrowserPluginGuest::WebContentsCreated(WebContents* source_contents, | 456 void BrowserPluginGuest::WebContentsCreated( |
| 457 int64 source_frame_id, | 457 WebContents* source_contents, |
| 458 const string16& frame_name, | 458 int64 source_frame_id, |
| 459 const GURL& target_url, | 459 const string16& frame_name, |
| 460 WebContents* new_contents) { | 460 const GURL& target_url, |
| 461 const WebKit::WindowFeatures& web_window_features, |
| 462 WebContents* new_contents) { |
| 461 WebContentsImpl* new_contents_impl = | 463 WebContentsImpl* new_contents_impl = |
| 462 static_cast<WebContentsImpl*>(new_contents); | 464 static_cast<WebContentsImpl*>(new_contents); |
| 463 BrowserPluginGuest* guest = new_contents_impl->GetBrowserPluginGuest(); | 465 BrowserPluginGuest* guest = new_contents_impl->GetBrowserPluginGuest(); |
| 464 guest->opener_ = AsWeakPtr(); | 466 guest->opener_ = AsWeakPtr(); |
| 465 guest->name_ = UTF16ToUTF8(frame_name); | 467 guest->name_ = UTF16ToUTF8(frame_name); |
| 466 // Take ownership of the new guest until it is attached to the embedder's DOM | 468 // Take ownership of the new guest until it is attached to the embedder's DOM |
| 467 // tree to avoid leaking a guest if this guest is destroyed before attaching | 469 // tree to avoid leaking a guest if this guest is destroyed before attaching |
| 468 // the new guest. | 470 // the new guest. |
| 469 pending_new_windows_.insert(std::make_pair(guest, TargetURL(target_url))); | 471 pending_new_windows_.insert(std::make_pair(guest, TargetURL(target_url))); |
| 470 } | 472 } |
| (...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1460 base::Value::CreateStringValue(request_method)); | 1462 base::Value::CreateStringValue(request_method)); |
| 1461 request_info.Set(browser_plugin::kURL, base::Value::CreateStringValue(url)); | 1463 request_info.Set(browser_plugin::kURL, base::Value::CreateStringValue(url)); |
| 1462 | 1464 |
| 1463 SendMessageToEmbedder( | 1465 SendMessageToEmbedder( |
| 1464 new BrowserPluginMsg_RequestPermission(instance_id(), | 1466 new BrowserPluginMsg_RequestPermission(instance_id(), |
| 1465 BrowserPluginPermissionTypeDownload, permission_request_id, | 1467 BrowserPluginPermissionTypeDownload, permission_request_id, |
| 1466 request_info)); | 1468 request_info)); |
| 1467 } | 1469 } |
| 1468 | 1470 |
| 1469 } // namespace content | 1471 } // namespace content |
| OLD | NEW |