| 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/npapi/webplugin_delegate_proxy.h" | 5 #include "content/renderer/npapi/webplugin_delegate_proxy.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 render_frame_->GetRoutingID(), url, page_url_, mime_type_, | 306 render_frame_->GetRoutingID(), url, page_url_, mime_type_, |
| 307 &channel_handle, &info_))) { | 307 &channel_handle, &info_))) { |
| 308 continue; | 308 continue; |
| 309 } | 309 } |
| 310 | 310 |
| 311 if (channel_handle.name.empty()) { | 311 if (channel_handle.name.empty()) { |
| 312 // We got an invalid handle. Either the plugin couldn't be found (which | 312 // We got an invalid handle. Either the plugin couldn't be found (which |
| 313 // shouldn't happen, since if we got here the plugin should exist) or the | 313 // shouldn't happen, since if we got here the plugin should exist) or the |
| 314 // plugin crashed on initialization. | 314 // plugin crashed on initialization. |
| 315 if (!info_.path.empty()) { | 315 if (!info_.path.empty()) { |
| 316 render_view_->main_render_frame()->PluginCrashed( | 316 render_view_->GetMainRenderFrame()->PluginCrashed( |
| 317 info_.path, base::kNullProcessId); | 317 info_.path, base::kNullProcessId); |
| 318 LOG(ERROR) << "Plug-in crashed on start"; | 318 LOG(ERROR) << "Plug-in crashed on start"; |
| 319 | 319 |
| 320 // Return true so that the plugin widget is created and we can paint the | 320 // Return true so that the plugin widget is created and we can paint the |
| 321 // crashed plugin there. | 321 // crashed plugin there. |
| 322 return true; | 322 return true; |
| 323 } | 323 } |
| 324 LOG(ERROR) << "Plug-in couldn't be found"; | 324 LOG(ERROR) << "Plug-in couldn't be found"; |
| 325 return false; | 325 return false; |
| 326 } | 326 } |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 void WebPluginDelegateProxy::OnChannelError() { | 480 void WebPluginDelegateProxy::OnChannelError() { |
| 481 if (plugin_) { | 481 if (plugin_) { |
| 482 if (window_) { | 482 if (window_) { |
| 483 // The actual WebPluginDelegate never got a chance to tell the WebPlugin | 483 // The actual WebPluginDelegate never got a chance to tell the WebPlugin |
| 484 // its window was going away. Do it on its behalf. | 484 // its window was going away. Do it on its behalf. |
| 485 WillDestroyWindow(); | 485 WillDestroyWindow(); |
| 486 } | 486 } |
| 487 plugin_->Invalidate(); | 487 plugin_->Invalidate(); |
| 488 } | 488 } |
| 489 if (channel_host_.get() && !channel_host_->expecting_shutdown()) { | 489 if (channel_host_.get() && !channel_host_->expecting_shutdown()) { |
| 490 render_view_->main_render_frame()->PluginCrashed( | 490 render_view_->GetMainRenderFrame()->PluginCrashed( |
| 491 info_.path, channel_host_->peer_pid()); | 491 info_.path, channel_host_->peer_pid()); |
| 492 } | 492 } |
| 493 | 493 |
| 494 #if defined(OS_MACOSX) || defined(OS_WIN) | 494 #if defined(OS_MACOSX) || defined(OS_WIN) |
| 495 // Ensure that the renderer doesn't think the plugin still has focus. | 495 // Ensure that the renderer doesn't think the plugin still has focus. |
| 496 if (render_view_) | 496 if (render_view_) |
| 497 render_view_->PluginFocusChanged(false, instance_id_); | 497 render_view_->PluginFocusChanged(false, instance_id_); |
| 498 #endif | 498 #endif |
| 499 } | 499 } |
| 500 | 500 |
| (...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1242 | 1242 |
| 1243 plugin_->URLRedirectResponse(allow, resource_id); | 1243 plugin_->URLRedirectResponse(allow, resource_id); |
| 1244 } | 1244 } |
| 1245 | 1245 |
| 1246 void WebPluginDelegateProxy::OnCheckIfRunInsecureContent(const GURL& url, | 1246 void WebPluginDelegateProxy::OnCheckIfRunInsecureContent(const GURL& url, |
| 1247 bool* result) { | 1247 bool* result) { |
| 1248 *result = plugin_->CheckIfRunInsecureContent(url); | 1248 *result = plugin_->CheckIfRunInsecureContent(url); |
| 1249 } | 1249 } |
| 1250 | 1250 |
| 1251 } // namespace content | 1251 } // namespace content |
| OLD | NEW |