| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 return host->GetScreenInfo(); | 586 return host->GetScreenInfo(); |
| 587 | 587 |
| 588 return WebScreenInfo(); | 588 return WebScreenInfo(); |
| 589 } | 589 } |
| 590 | 590 |
| 591 // WebFrameClient ------------------------------------------------------------ | 591 // WebFrameClient ------------------------------------------------------------ |
| 592 | 592 |
| 593 WebPlugin* TestWebViewDelegate::createPlugin(WebFrame* frame, | 593 WebPlugin* TestWebViewDelegate::createPlugin(WebFrame* frame, |
| 594 const WebPluginParams& params) { | 594 const WebPluginParams& params) { |
| 595 bool allow_wildcard = true; | 595 bool allow_wildcard = true; |
| 596 std::vector<webkit::npapi::WebPluginInfo> plugins; | 596 std::vector<webkit::WebPluginInfo> plugins; |
| 597 std::vector<std::string> mime_types; | 597 std::vector<std::string> mime_types; |
| 598 webkit::npapi::PluginList::Singleton()->GetPluginInfoArray( | 598 webkit::npapi::PluginList::Singleton()->GetPluginInfoArray( |
| 599 params.url, params.mimeType.utf8(), allow_wildcard, | 599 params.url, params.mimeType.utf8(), allow_wildcard, |
| 600 NULL, &plugins, &mime_types); | 600 NULL, &plugins, &mime_types); |
| 601 if (plugins.empty()) | 601 if (plugins.empty()) |
| 602 return NULL; | 602 return NULL; |
| 603 | 603 |
| 604 return new webkit::npapi::WebPluginImpl( | 604 return new webkit::npapi::WebPluginImpl( |
| 605 frame, params, plugins.front().path, mime_types.front(), AsWeakPtr()); | 605 frame, params, plugins.front().path, mime_types.front(), AsWeakPtr()); |
| 606 } | 606 } |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1125 } | 1125 } |
| 1126 | 1126 |
| 1127 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1127 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
| 1128 fake_rect_ = rect; | 1128 fake_rect_ = rect; |
| 1129 using_fake_rect_ = true; | 1129 using_fake_rect_ = true; |
| 1130 } | 1130 } |
| 1131 | 1131 |
| 1132 WebRect TestWebViewDelegate::fake_window_rect() { | 1132 WebRect TestWebViewDelegate::fake_window_rect() { |
| 1133 return fake_rect_; | 1133 return fake_rect_; |
| 1134 } | 1134 } |
| OLD | NEW |