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/renderer/browser_plugin/browser_plugin.h" | 5 #include "content/renderer/browser_plugin/browser_plugin.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "content/common/browser_plugin_messages.h" | 9 #include "content/common/browser_plugin_messages.h" |
10 #include "content/public/common/content_client.h" | 10 #include "content/public/common/content_client.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 std::string BrowserPlugin::GetSrcAttribute() const { | 86 std::string BrowserPlugin::GetSrcAttribute() const { |
87 return src_; | 87 return src_; |
88 } | 88 } |
89 | 89 |
90 void BrowserPlugin::SetSrcAttribute(const std::string& src) { | 90 void BrowserPlugin::SetSrcAttribute(const std::string& src) { |
91 if (src == src_ && !guest_crashed_) | 91 if (src == src_ && !guest_crashed_) |
92 return; | 92 return; |
93 if (!src.empty()) { | 93 if (!src.empty()) { |
94 BrowserPluginManager::Get()->Send( | 94 BrowserPluginManager::Get()->Send( |
95 new BrowserPluginHostMsg_NavigateOrCreateGuest( | 95 new BrowserPluginHostMsg_NavigateGuest( |
96 render_view_->GetRoutingID(), | 96 render_view_->GetRoutingID(), |
97 instance_id_, | 97 instance_id_, |
98 parent_frame_, | 98 parent_frame_, |
99 src)); | 99 src, |
| 100 gfx::Size(width(), height()))); |
100 } | 101 } |
101 src_ = src; | 102 src_ = src; |
102 guest_crashed_ = false; | 103 guest_crashed_ = false; |
103 } | 104 } |
104 | 105 |
105 bool BrowserPlugin::ParseSrcAttribute( | 106 bool BrowserPlugin::ParseSrcAttribute( |
106 const WebKit::WebPluginParams& params, | 107 const WebKit::WebPluginParams& params, |
107 std::string* src) { | 108 std::string* src) { |
108 // Get the src attribute from the attributes vector | 109 // Get the src attribute from the attributes vector |
109 for (unsigned i = 0; i < params.attributeNames.size(); ++i) { | 110 for (unsigned i = 0; i < params.attributeNames.size(); ++i) { |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 params.damage_buffer_id = new_damage_buffer->id(); | 347 params.damage_buffer_id = new_damage_buffer->id(); |
347 params.width = window_rect.width; | 348 params.width = window_rect.width; |
348 params.height = window_rect.height; | 349 params.height = window_rect.height; |
349 params.resize_pending = resize_pending_; | 350 params.resize_pending = resize_pending_; |
350 params.scale_factor = GetDeviceScaleFactor(); | 351 params.scale_factor = GetDeviceScaleFactor(); |
351 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_ResizeGuest( | 352 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_ResizeGuest( |
352 render_view_->GetRoutingID(), | 353 render_view_->GetRoutingID(), |
353 instance_id_, | 354 instance_id_, |
354 params)); | 355 params)); |
355 resize_pending_ = true; | 356 resize_pending_ = true; |
356 | |
357 if (damage_buffer_) { | 357 if (damage_buffer_) { |
358 RenderProcess::current()->FreeTransportDIB(damage_buffer_); | 358 RenderProcess::current()->FreeTransportDIB(damage_buffer_); |
359 damage_buffer_ = NULL; | 359 damage_buffer_ = NULL; |
360 } | 360 } |
361 damage_buffer_ = new_damage_buffer; | 361 damage_buffer_ = new_damage_buffer; |
362 } | 362 } |
363 | 363 |
364 void BrowserPlugin::updateFocus(bool focused) { | 364 void BrowserPlugin::updateFocus(bool focused) { |
365 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_SetFocus( | 365 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_SetFocus( |
366 render_view_->GetRoutingID(), | 366 render_view_->GetRoutingID(), |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 void* notify_data) { | 412 void* notify_data) { |
413 } | 413 } |
414 | 414 |
415 void BrowserPlugin::didFailLoadingFrameRequest( | 415 void BrowserPlugin::didFailLoadingFrameRequest( |
416 const WebKit::WebURL& url, | 416 const WebKit::WebURL& url, |
417 void* notify_data, | 417 void* notify_data, |
418 const WebKit::WebURLError& error) { | 418 const WebKit::WebURLError& error) { |
419 } | 419 } |
420 | 420 |
421 } // namespace content | 421 } // namespace content |
OLD | NEW |