| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "config.h" | 5 #include "config.h" |
| 6 #include "webkit/glue/webplugin_impl.h" | 6 #include "webkit/glue/webplugin_impl.h" |
| 7 | 7 |
| 8 #include "Cursor.h" | 8 #include "Cursor.h" |
| 9 #include "Document.h" | 9 #include "Document.h" |
| 10 #include "DocumentLoader.h" | 10 #include "DocumentLoader.h" |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 } | 627 } |
| 628 | 628 |
| 629 void WebPluginImpl::setFrameRect(const WebCore::IntRect& rect) { | 629 void WebPluginImpl::setFrameRect(const WebCore::IntRect& rect) { |
| 630 if (!parent()) | 630 if (!parent()) |
| 631 return; | 631 return; |
| 632 | 632 |
| 633 // Compute a new position and clip rect for ourselves relative to the | 633 // Compute a new position and clip rect for ourselves relative to the |
| 634 // containing window. We ask our delegate to reposition us accordingly. | 634 // containing window. We ask our delegate to reposition us accordingly. |
| 635 WebCore::Frame* frame = element_->document()->frame(); | 635 WebCore::Frame* frame = element_->document()->frame(); |
| 636 WebFrameImpl* webframe = WebFrameImpl::FromFrame(frame); | 636 WebFrameImpl* webframe = WebFrameImpl::FromFrame(frame); |
| 637 WebViewImpl* webview = webframe->webview_impl(); | 637 WebViewImpl* webview = webframe->GetWebViewImpl(); |
| 638 // It is valid for this function to be invoked in code paths where the | 638 // It is valid for this function to be invoked in code paths where the |
| 639 // the webview is closed. | 639 // the webview is closed. |
| 640 if (!webview->delegate()) { | 640 if (!webview->delegate()) { |
| 641 return; | 641 return; |
| 642 } | 642 } |
| 643 | 643 |
| 644 WebCore::IntRect window_rect; | 644 WebCore::IntRect window_rect; |
| 645 WebCore::IntRect clip_rect; | 645 WebCore::IntRect clip_rect; |
| 646 std::vector<gfx::Rect> cutout_rects; | 646 std::vector<gfx::Rect> cutout_rects; |
| 647 CalculateBounds(rect, &window_rect, &clip_rect, &cutout_rects); | 647 CalculateBounds(rect, &window_rect, &clip_rect, &cutout_rects); |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1312 multipart_boundary); | 1312 multipart_boundary); |
| 1313 multi_part_response_map_[client] = multi_part_response_handler; | 1313 multi_part_response_map_[client] = multi_part_response_handler; |
| 1314 } | 1314 } |
| 1315 | 1315 |
| 1316 bool WebPluginImpl::ReinitializePluginForResponse( | 1316 bool WebPluginImpl::ReinitializePluginForResponse( |
| 1317 WebCore::ResourceHandle* response_handle) { | 1317 WebCore::ResourceHandle* response_handle) { |
| 1318 WebFrameImpl* web_frame = WebFrameImpl::FromFrame(frame()); | 1318 WebFrameImpl* web_frame = WebFrameImpl::FromFrame(frame()); |
| 1319 if (!web_frame) | 1319 if (!web_frame) |
| 1320 return false; | 1320 return false; |
| 1321 | 1321 |
| 1322 WebViewImpl* web_view = web_frame->webview_impl(); | 1322 WebViewImpl* web_view = web_frame->GetWebViewImpl(); |
| 1323 if (!web_view) | 1323 if (!web_view) |
| 1324 return false; | 1324 return false; |
| 1325 | 1325 |
| 1326 WebPluginContainer* container_widget = widget_; | 1326 WebPluginContainer* container_widget = widget_; |
| 1327 | 1327 |
| 1328 // Destroy the current plugin instance. | 1328 // Destroy the current plugin instance. |
| 1329 TearDownPluginInstance(response_handle); | 1329 TearDownPluginInstance(response_handle); |
| 1330 | 1330 |
| 1331 widget_ = container_widget; | 1331 widget_ = container_widget; |
| 1332 webframe_ = web_frame; | 1332 webframe_ = web_frame; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1414 client_index = clients_.erase(client_index); | 1414 client_index = clients_.erase(client_index); |
| 1415 if (resource_client) | 1415 if (resource_client) |
| 1416 resource_client->DidFail(); | 1416 resource_client->DidFail(); |
| 1417 } | 1417 } |
| 1418 | 1418 |
| 1419 // This needs to be called now and not in the destructor since the | 1419 // This needs to be called now and not in the destructor since the |
| 1420 // webframe_ might not be valid anymore. | 1420 // webframe_ might not be valid anymore. |
| 1421 webframe_->set_plugin_delegate(NULL); | 1421 webframe_->set_plugin_delegate(NULL); |
| 1422 webframe_ = NULL; | 1422 webframe_ = NULL; |
| 1423 } | 1423 } |
| OLD | NEW |