| 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 // This file contains the implementation of TestWebViewDelegate, which serves | 5 // This file contains the implementation of TestWebViewDelegate, which serves |
| 6 // as the WebViewDelegate for the TestShellWebHost. The host is expected to | 6 // as the WebViewDelegate for the TestShellWebHost. The host is expected to |
| 7 // have initialized a MessageLoop before these methods are called. | 7 // have initialized a MessageLoop before these methods are called. |
| 8 | 8 |
| 9 #include "webkit/tools/test_shell/test_webview_delegate.h" | 9 #include "webkit/tools/test_shell/test_webview_delegate.h" |
| 10 | 10 |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 | 709 |
| 710 // WebFrameClient ------------------------------------------------------------ | 710 // WebFrameClient ------------------------------------------------------------ |
| 711 | 711 |
| 712 WebPlugin* TestWebViewDelegate::createPlugin(WebFrame* frame, | 712 WebPlugin* TestWebViewDelegate::createPlugin(WebFrame* frame, |
| 713 const WebPluginParams& params) { | 713 const WebPluginParams& params) { |
| 714 bool allow_wildcard = true; | 714 bool allow_wildcard = true; |
| 715 webkit::npapi::WebPluginInfo info; | 715 webkit::npapi::WebPluginInfo info; |
| 716 std::string actual_mime_type; | 716 std::string actual_mime_type; |
| 717 if (!webkit::npapi::PluginList::Singleton()->GetPluginInfo( | 717 if (!webkit::npapi::PluginList::Singleton()->GetPluginInfo( |
| 718 params.url, params.mimeType.utf8(), allow_wildcard, &info, | 718 params.url, params.mimeType.utf8(), allow_wildcard, &info, |
| 719 &actual_mime_type) || !info.enabled) | 719 &actual_mime_type) || !webkit::npapi::IsPluginEnabled(info)) |
| 720 return NULL; | 720 return NULL; |
| 721 | 721 |
| 722 return new webkit::npapi::WebPluginImpl( | 722 return new webkit::npapi::WebPluginImpl( |
| 723 frame, params, info.path, actual_mime_type, AsWeakPtr()); | 723 frame, params, info.path, actual_mime_type, AsWeakPtr()); |
| 724 } | 724 } |
| 725 | 725 |
| 726 WebWorker* TestWebViewDelegate::createWorker(WebFrame* frame, | 726 WebWorker* TestWebViewDelegate::createWorker(WebFrame* frame, |
| 727 WebWorkerClient* client) { | 727 WebWorkerClient* client) { |
| 728 return new TestWebWorker(); | 728 return new TestWebWorker(); |
| 729 } | 729 } |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1342 } | 1342 } |
| 1343 | 1343 |
| 1344 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1344 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
| 1345 fake_rect_ = rect; | 1345 fake_rect_ = rect; |
| 1346 using_fake_rect_ = true; | 1346 using_fake_rect_ = true; |
| 1347 } | 1347 } |
| 1348 | 1348 |
| 1349 WebRect TestWebViewDelegate::fake_window_rect() { | 1349 WebRect TestWebViewDelegate::fake_window_rect() { |
| 1350 return fake_rect_; | 1350 return fake_rect_; |
| 1351 } | 1351 } |
| OLD | NEW |