| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "webkit/glue/plugins/webplugin_impl.h" |
| 6 |
| 5 #include "base/logging.h" | 7 #include "base/logging.h" |
| 6 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 7 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 8 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 9 #include "gfx/rect.h" | 11 #include "gfx/rect.h" |
| 12 #include "googleurl/src/gurl.h" |
| 10 #include "net/base/escape.h" | 13 #include "net/base/escape.h" |
| 11 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
| 12 #include "skia/ext/platform_canvas.h" | 15 #include "skia/ext/platform_canvas.h" |
| 13 #include "third_party/WebKit/WebKit/chromium/public/WebConsoleMessage.h" | 16 #include "third_party/WebKit/WebKit/chromium/public/WebConsoleMessage.h" |
| 14 #include "third_party/WebKit/WebKit/chromium/public/WebCookieJar.h" | 17 #include "third_party/WebKit/WebKit/chromium/public/WebCookieJar.h" |
| 15 #include "third_party/WebKit/WebKit/chromium/public/WebCString.h" | 18 #include "third_party/WebKit/WebKit/chromium/public/WebCString.h" |
| 16 #include "third_party/WebKit/WebKit/chromium/public/WebCursorInfo.h" | 19 #include "third_party/WebKit/WebKit/chromium/public/WebCursorInfo.h" |
| 17 #include "third_party/WebKit/WebKit/chromium/public/WebDevToolsAgent.h" | 20 #include "third_party/WebKit/WebKit/chromium/public/WebDevToolsAgent.h" |
| 18 #include "third_party/WebKit/WebKit/chromium/public/WebData.h" | 21 #include "third_party/WebKit/WebKit/chromium/public/WebData.h" |
| 19 #include "third_party/WebKit/WebKit/chromium/public/WebDocument.h" | 22 #include "third_party/WebKit/WebKit/chromium/public/WebDocument.h" |
| 20 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" | 23 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" |
| 21 #include "third_party/WebKit/WebKit/chromium/public/WebHTTPBody.h" | 24 #include "third_party/WebKit/WebKit/chromium/public/WebHTTPBody.h" |
| 22 #include "third_party/WebKit/WebKit/chromium/public/WebHTTPHeaderVisitor.h" | 25 #include "third_party/WebKit/WebKit/chromium/public/WebHTTPHeaderVisitor.h" |
| 23 #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" | 26 #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" |
| 24 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" | 27 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" |
| 25 #include "third_party/WebKit/WebKit/chromium/public/WebKitClient.h" | 28 #include "third_party/WebKit/WebKit/chromium/public/WebKitClient.h" |
| 26 #include "third_party/WebKit/WebKit/chromium/public/WebPluginContainer.h" | 29 #include "third_party/WebKit/WebKit/chromium/public/WebPluginContainer.h" |
| 27 #include "third_party/WebKit/WebKit/chromium/public/WebPluginParams.h" | 30 #include "third_party/WebKit/WebKit/chromium/public/WebPluginParams.h" |
| 28 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" | 31 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" |
| 29 #include "third_party/WebKit/WebKit/chromium/public/WebURLError.h" | 32 #include "third_party/WebKit/WebKit/chromium/public/WebURLError.h" |
| 30 #include "third_party/WebKit/WebKit/chromium/public/WebURLLoader.h" | 33 #include "third_party/WebKit/WebKit/chromium/public/WebURLLoader.h" |
| 31 #include "third_party/WebKit/WebKit/chromium/public/WebURLLoaderClient.h" | 34 #include "third_party/WebKit/WebKit/chromium/public/WebURLLoaderClient.h" |
| 32 #include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h" | 35 #include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h" |
| 33 #include "third_party/WebKit/WebKit/chromium/public/WebView.h" | 36 #include "third_party/WebKit/WebKit/chromium/public/WebView.h" |
| 34 #include "webkit/glue/multipart_response_delegate.h" | 37 #include "webkit/glue/multipart_response_delegate.h" |
| 35 #include "webkit/glue/plugins/plugin_host.h" | 38 #include "webkit/glue/plugins/plugin_host.h" |
| 36 #include "webkit/glue/plugins/plugin_instance.h" | 39 #include "webkit/glue/plugins/plugin_instance.h" |
| 37 #include "webkit/glue/plugins/webplugin_delegate.h" | 40 #include "webkit/glue/plugins/webplugin_delegate.h" |
| 38 #include "webkit/glue/plugins/webplugin_impl.h" | |
| 39 #include "webkit/glue/plugins/webplugin_page_delegate.h" | 41 #include "webkit/glue/plugins/webplugin_page_delegate.h" |
| 40 #include "googleurl/src/gurl.h" | |
| 41 | 42 |
| 42 using WebKit::WebCanvas; | 43 using WebKit::WebCanvas; |
| 43 using WebKit::WebConsoleMessage; | 44 using WebKit::WebConsoleMessage; |
| 44 using WebKit::WebCookieJar; | 45 using WebKit::WebCookieJar; |
| 45 using WebKit::WebCString; | 46 using WebKit::WebCString; |
| 46 using WebKit::WebCursorInfo; | 47 using WebKit::WebCursorInfo; |
| 47 using WebKit::WebData; | 48 using WebKit::WebData; |
| 48 using WebKit::WebDataSource; | 49 using WebKit::WebDataSource; |
| 49 using WebKit::WebDevToolsAgent; | 50 using WebKit::WebDevToolsAgent; |
| 50 using WebKit::WebFrame; | 51 using WebKit::WebFrame; |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 return false; | 416 return false; |
| 416 | 417 |
| 417 return delegate_->PrintPage(page_number, canvas); | 418 return delegate_->PrintPage(page_number, canvas); |
| 418 } | 419 } |
| 419 | 420 |
| 420 void WebPluginImpl::printEnd() { | 421 void WebPluginImpl::printEnd() { |
| 421 if (delegate_) | 422 if (delegate_) |
| 422 delegate_->PrintEnd(); | 423 delegate_->PrintEnd(); |
| 423 } | 424 } |
| 424 | 425 |
| 425 WebString WebPluginImpl::selectedText() { | 426 bool WebPluginImpl::hasSelection() const { |
| 427 if (!delegate_) |
| 428 return false; |
| 429 |
| 430 return delegate_->HasSelection(); |
| 431 } |
| 432 |
| 433 WebKit::WebString WebPluginImpl::selectionAsText() const { |
| 426 if (!delegate_) | 434 if (!delegate_) |
| 427 return WebString(); | 435 return WebString(); |
| 428 | 436 |
| 429 return delegate_->GetSelectedText(); | 437 return delegate_->GetSelectionAsText(); |
| 438 } |
| 439 |
| 440 WebKit::WebString WebPluginImpl::selectionAsMarkup() const { |
| 441 if (!delegate_) |
| 442 return WebString(); |
| 443 |
| 444 return delegate_->GetSelectionAsMarkup(); |
| 445 } |
| 446 |
| 447 void WebPluginImpl::setZoomFactor(float scale, bool text_only) { |
| 448 if (delegate_) |
| 449 delegate_->SetZoomFactor(scale, text_only); |
| 450 } |
| 451 |
| 452 bool WebPluginImpl::supportsFind() { |
| 453 return delegate_ && delegate_->SupportsFind(); |
| 454 } |
| 455 |
| 456 void WebPluginImpl::startFind(const WebString& search_text, |
| 457 bool case_sensitive, |
| 458 int identifier) { |
| 459 if (delegate_) |
| 460 delegate_->StartFind(search_text, case_sensitive, identifier); |
| 461 } |
| 462 |
| 463 void WebPluginImpl::selectFindResult(bool forward) { |
| 464 if (delegate_) |
| 465 delegate_->SelectFindResult(forward); |
| 466 } |
| 467 |
| 468 void WebPluginImpl::stopFind() { |
| 469 if (delegate_) |
| 470 delegate_->StopFind(); |
| 430 } | 471 } |
| 431 | 472 |
| 432 | 473 |
| 433 // ----------------------------------------------------------------------------- | 474 // ----------------------------------------------------------------------------- |
| 434 | 475 |
| 435 WebPluginImpl::WebPluginImpl( | 476 WebPluginImpl::WebPluginImpl( |
| 436 WebFrame* webframe, | 477 WebFrame* webframe, |
| 437 const WebPluginParams& params, | 478 const WebPluginParams& params, |
| 438 const FilePath& file_path, | 479 const FilePath& file_path, |
| 439 const std::string& mime_type, | 480 const std::string& mime_type, |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1258 WebDevToolsAgent* WebPluginImpl::GetDevToolsAgent() { | 1299 WebDevToolsAgent* WebPluginImpl::GetDevToolsAgent() { |
| 1259 if (!webframe_) | 1300 if (!webframe_) |
| 1260 return NULL; | 1301 return NULL; |
| 1261 WebView* view = webframe_->view(); | 1302 WebView* view = webframe_->view(); |
| 1262 if (!view) | 1303 if (!view) |
| 1263 return NULL; | 1304 return NULL; |
| 1264 return view->devToolsAgent(); | 1305 return view->devToolsAgent(); |
| 1265 } | 1306 } |
| 1266 | 1307 |
| 1267 } // namespace webkit_glue | 1308 } // namespace webkit_glue |
| OLD | NEW |