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 #undef LOG | 5 #undef LOG |
6 | 6 |
7 #include "webkit/tools/test_shell/test_shell.h" | 7 #include "webkit/tools/test_shell/test_shell.h" |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 return speech_input_controller_mock_.get(); | 617 return speech_input_controller_mock_.get(); |
618 } | 618 } |
619 | 619 |
620 WebKit::WebGeolocationClientMock* TestShell::geolocation_client_mock() { | 620 WebKit::WebGeolocationClientMock* TestShell::geolocation_client_mock() { |
621 if (!geolocation_client_mock_.get()) { | 621 if (!geolocation_client_mock_.get()) { |
622 geolocation_client_mock_.reset( | 622 geolocation_client_mock_.reset( |
623 WebKit::WebGeolocationClientMock::create()); | 623 WebKit::WebGeolocationClientMock::create()); |
624 } | 624 } |
625 return geolocation_client_mock_.get(); | 625 return geolocation_client_mock_.get(); |
626 } | 626 } |
| 627 |
| 628 //----------------------------------------------------------------------------- |
| 629 |
| 630 namespace webkit_glue { |
| 631 |
| 632 bool IsProtocolSupportedForMedia(const GURL& url) { |
| 633 if (url.SchemeIsFile() || |
| 634 url.SchemeIs("http") || |
| 635 url.SchemeIs("https") || |
| 636 url.SchemeIs("data") || |
| 637 url.SchemeIsFileSystem()) |
| 638 return true; |
| 639 return false; |
| 640 } |
| 641 |
| 642 void GetPlugins(bool refresh, |
| 643 std::vector<webkit::WebPluginInfo>* plugins) { |
| 644 if (refresh) |
| 645 webkit::npapi::PluginList::Singleton()->RefreshPlugins(); |
| 646 webkit::npapi::PluginList::Singleton()->GetPlugins(plugins); |
| 647 // Don't load the forked TestNetscapePlugIn in the chromium code, use |
| 648 // the copy in webkit.org's repository instead. |
| 649 const FilePath::StringType kPluginBlackList[] = { |
| 650 FILE_PATH_LITERAL("npapi_layout_test_plugin.dll"), |
| 651 FILE_PATH_LITERAL("WebKitTestNetscapePlugIn.plugin"), |
| 652 FILE_PATH_LITERAL("libnpapi_layout_test_plugin.so"), |
| 653 }; |
| 654 for (int i = plugins->size() - 1; i >= 0; --i) { |
| 655 webkit::WebPluginInfo plugin_info = plugins->at(i); |
| 656 for (size_t j = 0; j < arraysize(kPluginBlackList); ++j) { |
| 657 if (plugin_info.path.BaseName() == FilePath(kPluginBlackList[j])) { |
| 658 plugins->erase(plugins->begin() + i); |
| 659 } |
| 660 } |
| 661 } |
| 662 } |
| 663 |
| 664 } // namespace webkit_glue |
OLD | NEW |