| 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 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 | 667 |
| 668 // WebFrameClient ------------------------------------------------------------ | 668 // WebFrameClient ------------------------------------------------------------ |
| 669 | 669 |
| 670 WebPlugin* TestWebViewDelegate::createPlugin( | 670 WebPlugin* TestWebViewDelegate::createPlugin( |
| 671 WebFrame* frame, const WebPluginParams& params) { | 671 WebFrame* frame, const WebPluginParams& params) { |
| 672 bool allow_wildcard = true; | 672 bool allow_wildcard = true; |
| 673 WebPluginInfo info; | 673 WebPluginInfo info; |
| 674 std::string actual_mime_type; | 674 std::string actual_mime_type; |
| 675 if (!NPAPI::PluginList::Singleton()->GetPluginInfo( | 675 if (!NPAPI::PluginList::Singleton()->GetPluginInfo( |
| 676 params.url, params.mimeType.utf8(), allow_wildcard, &info, | 676 params.url, params.mimeType.utf8(), allow_wildcard, &info, |
| 677 &actual_mime_type)) { | 677 &actual_mime_type) || !info.enabled) { |
| 678 return NULL; | 678 return NULL; |
| 679 } | 679 } |
| 680 | 680 |
| 681 if (actual_mime_type.empty()) | 681 if (actual_mime_type.empty()) |
| 682 actual_mime_type = params.mimeType.utf8(); | 682 actual_mime_type = params.mimeType.utf8(); |
| 683 | 683 |
| 684 return new webkit_glue::WebPluginImpl( | 684 return new webkit_glue::WebPluginImpl( |
| 685 frame, params, info.path, actual_mime_type, AsWeakPtr()); | 685 frame, params, info.path, actual_mime_type, AsWeakPtr()); |
| 686 } | 686 } |
| 687 | 687 |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1296 } | 1296 } |
| 1297 | 1297 |
| 1298 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1298 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
| 1299 fake_rect_ = rect; | 1299 fake_rect_ = rect; |
| 1300 using_fake_rect_ = true; | 1300 using_fake_rect_ = true; |
| 1301 } | 1301 } |
| 1302 | 1302 |
| 1303 WebRect TestWebViewDelegate::fake_window_rect() { | 1303 WebRect TestWebViewDelegate::fake_window_rect() { |
| 1304 return fake_rect_; | 1304 return fake_rect_; |
| 1305 } | 1305 } |
| OLD | NEW |