Chromium Code Reviews| Index: content/renderer/browser_plugin/browser_plugin.cc |
| diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc |
| index 8ba5421f33aa700fe63e733024d9a5185ed74684..df5a77d1993187a0ad5b3d43a172ab4dc23d46a8 100644 |
| --- a/content/renderer/browser_plugin/browser_plugin.cc |
| +++ b/content/renderer/browser_plugin/browser_plugin.cc |
| @@ -54,6 +54,7 @@ BrowserPlugin::BrowserPlugin( |
| sad_guest_(NULL), |
| guest_crashed_(false), |
| resize_pending_(false), |
| + navigate_src_sent_(false), |
| parent_frame_(frame->identifier()) { |
| BrowserPluginManager::Get()->AddBrowserPlugin(instance_id, this); |
| bindings_.reset(new BrowserPluginBindings(this)); |
| @@ -90,13 +91,18 @@ std::string BrowserPlugin::GetSrcAttribute() const { |
| void BrowserPlugin::SetSrcAttribute(const std::string& src) { |
| if (src == src_ && !guest_crashed_) |
| return; |
| - if (!src.empty()) { |
| + if (!src.empty() || navigate_src_sent_) { |
| BrowserPluginManager::Get()->Send( |
| - new BrowserPluginHostMsg_NavigateOrCreateGuest( |
| + new BrowserPluginHostMsg_NavigateGuest( |
| render_view_->GetRoutingID(), |
| instance_id_, |
| parent_frame_, |
| - src)); |
| + src, |
| + gfx::Size(width(), height()))); |
| + // Record that we sent a NavigateGuest message to embedder, once we send |
| + // such message, subsequent SetSrcAttribute must always send NavigateGuest |
|
awong
2012/09/06 00:23:27
nits:
embedder, once -> embedder. Once
such messa
lazyboy
2012/09/06 04:33:53
Done.
|
| + // message to the embedder even if src is empty. |
|
awong
2012/09/06 00:23:27
nit: message to -> messages to
lazyboy
2012/09/06 04:33:53
Done.
|
| + navigate_src_sent_ = true; |
| } |
| src_ = src; |
| guest_crashed_ = false; |
| @@ -329,6 +335,11 @@ void BrowserPlugin::updateGeometry( |
| if (old_width == window_rect.width && |
| old_height == window_rect.height) |
| return; |
| + // If we didn't ever load a guest (navigate_src_sent_ = false), we ignore |
| + // sending anything anything to embedder until an actual navigation (non empty |
|
awong
2012/09/06 00:23:27
nit: anything anything -> anything
Same as above,
lazyboy
2012/09/06 04:33:53
Done.
|
| + // src) happens. |
| + if (src_.empty() && !navigate_src_sent_) |
| + return; |
| const size_t stride = skia::PlatformCanvas::StrideForWidth(window_rect.width); |
| const size_t size = window_rect.height * |