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 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 | 704 |
705 // WebFrameClient ------------------------------------------------------------ | 705 // WebFrameClient ------------------------------------------------------------ |
706 | 706 |
707 WebPlugin* TestWebViewDelegate::createPlugin(WebFrame* frame, | 707 WebPlugin* TestWebViewDelegate::createPlugin(WebFrame* frame, |
708 const WebPluginParams& params) { | 708 const WebPluginParams& params) { |
709 bool allow_wildcard = true; | 709 bool allow_wildcard = true; |
710 webkit::npapi::WebPluginInfo info; | 710 webkit::npapi::WebPluginInfo info; |
711 std::string actual_mime_type; | 711 std::string actual_mime_type; |
712 if (!webkit::npapi::PluginList::Singleton()->GetPluginInfo( | 712 if (!webkit::npapi::PluginList::Singleton()->GetPluginInfo( |
713 params.url, params.mimeType.utf8(), allow_wildcard, &info, | 713 params.url, params.mimeType.utf8(), allow_wildcard, &info, |
714 &actual_mime_type) || !info.enabled) | 714 &actual_mime_type) || !webkit::npapi::IsPluginEnabled(info)) |
715 return NULL; | 715 return NULL; |
716 | 716 |
717 return new webkit::npapi::WebPluginImpl( | 717 return new webkit::npapi::WebPluginImpl( |
718 frame, params, info.path, actual_mime_type, AsWeakPtr()); | 718 frame, params, info.path, actual_mime_type, AsWeakPtr()); |
719 } | 719 } |
720 | 720 |
721 WebWorker* TestWebViewDelegate::createWorker(WebFrame* frame, | 721 WebWorker* TestWebViewDelegate::createWorker(WebFrame* frame, |
722 WebWorkerClient* client) { | 722 WebWorkerClient* client) { |
723 return new TestWebWorker(); | 723 return new TestWebWorker(); |
724 } | 724 } |
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1337 } | 1337 } |
1338 | 1338 |
1339 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1339 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
1340 fake_rect_ = rect; | 1340 fake_rect_ = rect; |
1341 using_fake_rect_ = true; | 1341 using_fake_rect_ = true; |
1342 } | 1342 } |
1343 | 1343 |
1344 WebRect TestWebViewDelegate::fake_window_rect() { | 1344 WebRect TestWebViewDelegate::fake_window_rect() { |
1345 return fake_rect_; | 1345 return fake_rect_; |
1346 } | 1346 } |
OLD | NEW |