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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 delegate_.reset(new TestWebViewDelegate(this)); | 139 delegate_.reset(new TestWebViewDelegate(this)); |
140 popup_delegate_.reset(new TestWebViewDelegate(this)); | 140 popup_delegate_.reset(new TestWebViewDelegate(this)); |
141 layout_test_controller_.reset(new LayoutTestController(this)); | 141 layout_test_controller_.reset(new LayoutTestController(this)); |
142 navigation_controller_.reset(new TestNavigationController(this)); | 142 navigation_controller_.reset(new TestNavigationController(this)); |
143 notification_presenter_.reset(new TestNotificationPresenter(this)); | 143 notification_presenter_.reset(new TestNotificationPresenter(this)); |
144 | 144 |
145 net::URLRequestFilter* filter = net::URLRequestFilter::GetInstance(); | 145 net::URLRequestFilter* filter = net::URLRequestFilter::GetInstance(); |
146 filter->AddHostnameHandler("test-shell-resource", "inspector", | 146 filter->AddHostnameHandler("test-shell-resource", "inspector", |
147 &URLRequestTestShellFileJob::InspectorFactory); | 147 &URLRequestTestShellFileJob::InspectorFactory); |
148 url_util::AddStandardScheme("test-shell-resource"); | 148 url_util::AddStandardScheme("test-shell-resource"); |
149 webkit_glue::SetUserAgent("TestShell", false); | |
150 } | 149 } |
151 | 150 |
152 TestShell::~TestShell() { | 151 TestShell::~TestShell() { |
153 delegate_->RevokeDragDrop(); | 152 delegate_->RevokeDragDrop(); |
154 | 153 |
155 // DevTools frontend page is supposed to be navigated only once and | 154 // DevTools frontend page is supposed to be navigated only once and |
156 // loading another URL in that Page is an error. | 155 // loading another URL in that Page is an error. |
157 if (!dev_tools_client_.get()) { | 156 if (!dev_tools_client_.get()) { |
158 // Navigate to an empty page to fire all the destruction logic for the | 157 // Navigate to an empty page to fire all the destruction logic for the |
159 // current page. | 158 // current page. |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 | 628 |
630 bool IsProtocolSupportedForMedia(const GURL& url) { | 629 bool IsProtocolSupportedForMedia(const GURL& url) { |
631 if (url.SchemeIsFile() || | 630 if (url.SchemeIsFile() || |
632 url.SchemeIs("http") || | 631 url.SchemeIs("http") || |
633 url.SchemeIs("https") || | 632 url.SchemeIs("https") || |
634 url.SchemeIs("data")) | 633 url.SchemeIs("data")) |
635 return true; | 634 return true; |
636 return false; | 635 return false; |
637 } | 636 } |
638 | 637 |
| 638 std::string BuildUserAgent(bool mimic_windows) { |
| 639 return webkit_glue::BuildUserAgentHelper(mimic_windows, "Chrome/0.0.0.0"); |
| 640 } |
| 641 |
639 #if defined(OS_LINUX) | 642 #if defined(OS_LINUX) |
640 int MatchFontWithFallback(const std::string& face, bool bold, | 643 int MatchFontWithFallback(const std::string& face, bool bold, |
641 bool italic, int charset) { | 644 bool italic, int charset) { |
642 return -1; | 645 return -1; |
643 } | 646 } |
644 | 647 |
645 bool GetFontTable(int fd, uint32_t table, uint8_t* output, | 648 bool GetFontTable(int fd, uint32_t table, uint8_t* output, |
646 size_t* output_length) { | 649 size_t* output_length) { |
647 return false; | 650 return false; |
648 } | 651 } |
(...skipping 15 matching lines...) Expand all Loading... |
664 webkit::WebPluginInfo plugin_info = plugins->at(i); | 667 webkit::WebPluginInfo plugin_info = plugins->at(i); |
665 for (size_t j = 0; j < arraysize(kPluginBlackList); ++j) { | 668 for (size_t j = 0; j < arraysize(kPluginBlackList); ++j) { |
666 if (plugin_info.path.BaseName() == FilePath(kPluginBlackList[j])) { | 669 if (plugin_info.path.BaseName() == FilePath(kPluginBlackList[j])) { |
667 plugins->erase(plugins->begin() + i); | 670 plugins->erase(plugins->begin() + i); |
668 } | 671 } |
669 } | 672 } |
670 } | 673 } |
671 } | 674 } |
672 | 675 |
673 } // namespace webkit_glue | 676 } // namespace webkit_glue |
OLD | NEW |