Chromium Code Reviews| 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 #if defined (OS_WIN) | 9 #if defined (OS_WIN) |
| 10 #include "base/sys_info.h" | 10 #include "base/sys_info.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 EventListeners& listeners = | 142 EventListeners& listeners = |
| 143 event_listener_map_[event_listener_map_iter->first]; | 143 event_listener_map_[event_listener_map_iter->first]; |
| 144 EventListeners::iterator it = listeners.begin(); | 144 EventListeners::iterator it = listeners.begin(); |
| 145 for (; it != listeners.end(); ++it) { | 145 for (; it != listeners.end(); ++it) { |
| 146 it->Dispose(); | 146 it->Dispose(); |
| 147 } | 147 } |
| 148 } | 148 } |
| 149 event_listener_map_.clear(); | 149 event_listener_map_.clear(); |
| 150 } | 150 } |
| 151 | 151 |
| 152 void BrowserPlugin::Stop() { | |
| 153 if (!navigate_src_sent_) | |
| 154 return; | |
| 155 BrowserPluginManager::Get()->Send( | |
| 156 new BrowserPluginHostMsg_Stop(render_view_->GetRoutingID(), | |
| 157 instance_id_)); | |
| 158 } | |
| 159 | |
| 160 void BrowserPlugin::Reload() { | |
| 161 if (!navigate_src_sent_) | |
| 162 return; | |
| 163 // Renavigate to the same URL if the guest has crashed. | |
|
Charlie Reis
2012/09/19 22:17:09
Is this necessary? I think NavigationController::
Fady Samuel
2012/09/19 23:29:20
Done. The guest_crashed_ flag needs to be reset. b
| |
| 164 if (guest_crashed_) { | |
| 165 SetSrcAttribute(src_); | |
| 166 return; | |
| 167 } | |
| 168 BrowserPluginManager::Get()->Send( | |
| 169 new BrowserPluginHostMsg_Reload(render_view_->GetRoutingID(), | |
| 170 instance_id_)); | |
| 171 } | |
| 172 | |
| 152 void BrowserPlugin::UpdateRect( | 173 void BrowserPlugin::UpdateRect( |
| 153 int message_id, | 174 int message_id, |
| 154 const BrowserPluginMsg_UpdateRect_Params& params) { | 175 const BrowserPluginMsg_UpdateRect_Params& params) { |
| 155 if (width() != params.view_size.width() || | 176 if (width() != params.view_size.width() || |
| 156 height() != params.view_size.height()) { | 177 height() != params.view_size.height()) { |
| 157 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_UpdateRect_ACK( | 178 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_UpdateRect_ACK( |
| 158 render_view_->GetRoutingID(), | 179 render_view_->GetRoutingID(), |
| 159 instance_id_, | 180 instance_id_, |
| 160 message_id, | 181 message_id, |
| 161 gfx::Size(width(), height()))); | 182 gfx::Size(width(), height()))); |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 453 void* notify_data) { | 474 void* notify_data) { |
| 454 } | 475 } |
| 455 | 476 |
| 456 void BrowserPlugin::didFailLoadingFrameRequest( | 477 void BrowserPlugin::didFailLoadingFrameRequest( |
| 457 const WebKit::WebURL& url, | 478 const WebKit::WebURL& url, |
| 458 void* notify_data, | 479 void* notify_data, |
| 459 const WebKit::WebURLError& error) { | 480 const WebKit::WebURLError& error) { |
| 460 } | 481 } |
| 461 | 482 |
| 462 } // namespace content | 483 } // namespace content |
| OLD | NEW |