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 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 | 702 |
703 // WebFrameClient ------------------------------------------------------------ | 703 // WebFrameClient ------------------------------------------------------------ |
704 | 704 |
705 WebPlugin* TestWebViewDelegate::createPlugin(WebFrame* frame, | 705 WebPlugin* TestWebViewDelegate::createPlugin(WebFrame* frame, |
706 const WebPluginParams& params) { | 706 const WebPluginParams& params) { |
707 bool allow_wildcard = true; | 707 bool allow_wildcard = true; |
708 webkit::npapi::WebPluginInfo info; | 708 webkit::npapi::WebPluginInfo info; |
709 std::string actual_mime_type; | 709 std::string actual_mime_type; |
710 if (!webkit::npapi::PluginList::Singleton()->GetPluginInfo( | 710 if (!webkit::npapi::PluginList::Singleton()->GetPluginInfo( |
711 params.url, params.mimeType.utf8(), allow_wildcard, &info, | 711 params.url, params.mimeType.utf8(), allow_wildcard, &info, |
712 &actual_mime_type) || !info.enabled) | 712 &actual_mime_type) || !webkit::npapi::IsPluginEnabled(info)) |
713 return NULL; | 713 return NULL; |
714 | 714 |
715 return new webkit::npapi::WebPluginImpl( | 715 return new webkit::npapi::WebPluginImpl( |
716 frame, params, info.path, actual_mime_type, AsWeakPtr()); | 716 frame, params, info.path, actual_mime_type, AsWeakPtr()); |
717 } | 717 } |
718 | 718 |
719 WebWorker* TestWebViewDelegate::createWorker(WebFrame* frame, | 719 WebWorker* TestWebViewDelegate::createWorker(WebFrame* frame, |
720 WebWorkerClient* client) { | 720 WebWorkerClient* client) { |
721 return new TestWebWorker(); | 721 return new TestWebWorker(); |
722 } | 722 } |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1321 } | 1321 } |
1322 | 1322 |
1323 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1323 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
1324 fake_rect_ = rect; | 1324 fake_rect_ = rect; |
1325 using_fake_rect_ = true; | 1325 using_fake_rect_ = true; |
1326 } | 1326 } |
1327 | 1327 |
1328 WebRect TestWebViewDelegate::fake_window_rect() { | 1328 WebRect TestWebViewDelegate::fake_window_rect() { |
1329 return fake_rect_; | 1329 return fake_rect_; |
1330 } | 1330 } |
OLD | NEW |