| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "base/gfx/rect.h" | 5 #include "base/gfx/rect.h" |
| 6 #include "base/logging.h" | 6 #include "base/logging.h" |
| 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 "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "net/base/escape.h" | 10 #include "net/base/escape.h" |
| 11 #include "net/base/net_errors.h" |
| 11 #include "skia/ext/platform_canvas.h" | 12 #include "skia/ext/platform_canvas.h" |
| 12 #include "webkit/api/public/WebConsoleMessage.h" | 13 #include "webkit/api/public/WebConsoleMessage.h" |
| 13 #include "webkit/api/public/WebCString.h" | 14 #include "webkit/api/public/WebCString.h" |
| 14 #include "webkit/api/public/WebCursorInfo.h" | 15 #include "webkit/api/public/WebCursorInfo.h" |
| 15 #include "webkit/api/public/WebData.h" | 16 #include "webkit/api/public/WebData.h" |
| 16 #include "webkit/api/public/WebFrame.h" | 17 #include "webkit/api/public/WebFrame.h" |
| 17 #include "webkit/api/public/WebHTTPBody.h" | 18 #include "webkit/api/public/WebHTTPBody.h" |
| 18 #include "webkit/api/public/WebHTTPHeaderVisitor.h" | 19 #include "webkit/api/public/WebHTTPHeaderVisitor.h" |
| 19 #include "webkit/api/public/WebInputEvent.h" | 20 #include "webkit/api/public/WebInputEvent.h" |
| 20 #include "webkit/api/public/WebKit.h" | 21 #include "webkit/api/public/WebKit.h" |
| 21 #include "webkit/api/public/WebKitClient.h" | 22 #include "webkit/api/public/WebKitClient.h" |
| 22 #include "webkit/api/public/WebPluginContainer.h" | 23 #include "webkit/api/public/WebPluginContainer.h" |
| 23 #include "webkit/api/public/WebPluginParams.h" | 24 #include "webkit/api/public/WebPluginParams.h" |
| 24 #include "webkit/api/public/WebRect.h" | 25 #include "webkit/api/public/WebRect.h" |
| 25 #include "webkit/api/public/WebURL.h" | 26 #include "webkit/api/public/WebURL.h" |
| 27 #include "webkit/api/public/WebURLError.h" |
| 26 #include "webkit/api/public/WebURLLoader.h" | 28 #include "webkit/api/public/WebURLLoader.h" |
| 27 #include "webkit/api/public/WebURLLoaderClient.h" | 29 #include "webkit/api/public/WebURLLoaderClient.h" |
| 28 #include "webkit/api/public/WebURLResponse.h" | 30 #include "webkit/api/public/WebURLResponse.h" |
| 29 #include "webkit/api/public/WebView.h" | 31 #include "webkit/api/public/WebView.h" |
| 30 #include "webkit/glue/multipart_response_delegate.h" | 32 #include "webkit/glue/multipart_response_delegate.h" |
| 31 #include "webkit/glue/webplugin_impl.h" | 33 #include "webkit/glue/webplugin_impl.h" |
| 32 #include "webkit/glue/plugins/plugin_host.h" | 34 #include "webkit/glue/plugins/plugin_host.h" |
| 33 #include "webkit/glue/plugins/plugin_instance.h" | 35 #include "webkit/glue/plugins/plugin_instance.h" |
| 34 #include "webkit/glue/webplugin_delegate.h" | 36 #include "webkit/glue/webplugin_delegate.h" |
| 35 #include "webkit/glue/webplugin_page_delegate.h" | 37 #include "webkit/glue/webplugin_page_delegate.h" |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 void WebPluginImpl::didFinishLoadingFrameRequest( | 349 void WebPluginImpl::didFinishLoadingFrameRequest( |
| 348 const WebURL& url, void* notify_data) { | 350 const WebURL& url, void* notify_data) { |
| 349 if (delegate_) { | 351 if (delegate_) { |
| 350 delegate_->DidFinishLoadWithReason( | 352 delegate_->DidFinishLoadWithReason( |
| 351 url, NPRES_DONE, reinterpret_cast<intptr_t>(notify_data)); | 353 url, NPRES_DONE, reinterpret_cast<intptr_t>(notify_data)); |
| 352 } | 354 } |
| 353 } | 355 } |
| 354 | 356 |
| 355 void WebPluginImpl::didFailLoadingFrameRequest( | 357 void WebPluginImpl::didFailLoadingFrameRequest( |
| 356 const WebURL& url, void* notify_data, const WebURLError& error) { | 358 const WebURL& url, void* notify_data, const WebURLError& error) { |
| 357 // TODO(darin): Map net::ERR_ABORTED to NPRES_USER_BREAK? | 359 if (!delegate_) |
| 358 if (delegate_) { | 360 return; |
| 359 delegate_->DidFinishLoadWithReason( | 361 |
| 360 url, NPRES_NETWORK_ERR, reinterpret_cast<intptr_t>(notify_data)); | 362 NPReason reason = |
| 361 } | 363 error.reason == net::ERR_ABORTED ? NPRES_USER_BREAK : NPRES_NETWORK_ERR; |
| 364 delegate_->DidFinishLoadWithReason( |
| 365 url, reason, reinterpret_cast<intptr_t>(notify_data)); |
| 362 } | 366 } |
| 363 | 367 |
| 364 // ----------------------------------------------------------------------------- | 368 // ----------------------------------------------------------------------------- |
| 365 | 369 |
| 366 WebPluginImpl::WebPluginImpl( | 370 WebPluginImpl::WebPluginImpl( |
| 367 WebFrame* webframe, const WebPluginParams& params, | 371 WebFrame* webframe, const WebPluginParams& params, |
| 368 const base::WeakPtr<WebPluginPageDelegate>& page_delegate) | 372 const base::WeakPtr<WebPluginPageDelegate>& page_delegate) |
| 369 : windowless_(false), | 373 : windowless_(false), |
| 370 window_(NULL), | 374 window_(NULL), |
| 371 page_delegate_(page_delegate), | 375 page_delegate_(page_delegate), |
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1047 client_index = clients_.erase(client_index); | 1051 client_index = clients_.erase(client_index); |
| 1048 } | 1052 } |
| 1049 | 1053 |
| 1050 // This needs to be called now and not in the destructor since the | 1054 // This needs to be called now and not in the destructor since the |
| 1051 // webframe_ might not be valid anymore. | 1055 // webframe_ might not be valid anymore. |
| 1052 webframe_ = NULL; | 1056 webframe_ = NULL; |
| 1053 method_factory_.RevokeAll(); | 1057 method_factory_.RevokeAll(); |
| 1054 } | 1058 } |
| 1055 | 1059 |
| 1056 } // namespace webkit_glue | 1060 } // namespace webkit_glue |
| OLD | NEW |