| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "components/test_runner/web_view_test_client.h" | 5 #include "components/test_runner/web_view_test_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 // Simulate a print by going into print mode and then exit straight away. | 96 // Simulate a print by going into print mode and then exit straight away. |
| 97 void WebViewTestClient::printPage(blink::WebLocalFrame* frame) { | 97 void WebViewTestClient::printPage(blink::WebLocalFrame* frame) { |
| 98 blink::WebSize page_size_in_pixels = frame->view()->size(); | 98 blink::WebSize page_size_in_pixels = frame->view()->size(); |
| 99 if (page_size_in_pixels.isEmpty()) | 99 if (page_size_in_pixels.isEmpty()) |
| 100 return; | 100 return; |
| 101 blink::WebPrintParams printParams(page_size_in_pixels); | 101 blink::WebPrintParams printParams(page_size_in_pixels); |
| 102 frame->printBegin(printParams); | 102 frame->printBegin(printParams); |
| 103 frame->printEnd(); | 103 frame->printEnd(); |
| 104 } | 104 } |
| 105 | 105 |
| 106 bool WebViewTestClient::runFileChooser( | |
| 107 const blink::WebFileChooserParams& params, | |
| 108 blink::WebFileChooserCompletion* completion) { | |
| 109 delegate()->PrintMessage("Mock: Opening a file chooser.\n"); | |
| 110 // FIXME: Add ability to set file names to a file upload control. | |
| 111 return false; | |
| 112 } | |
| 113 | |
| 114 void WebViewTestClient::showValidationMessage( | 106 void WebViewTestClient::showValidationMessage( |
| 115 const blink::WebRect& anchor_in_root_view, | 107 const blink::WebRect& anchor_in_root_view, |
| 116 const blink::WebString& main_message, | 108 const blink::WebString& main_message, |
| 117 blink::WebTextDirection main_message_hint, | 109 blink::WebTextDirection main_message_hint, |
| 118 const blink::WebString& sub_message, | 110 const blink::WebString& sub_message, |
| 119 blink::WebTextDirection sub_message_hint) { | 111 blink::WebTextDirection sub_message_hint) { |
| 120 base::string16 wrapped_main_text = main_message; | 112 base::string16 wrapped_main_text = main_message; |
| 121 base::string16 wrapped_sub_text = sub_message; | 113 base::string16 wrapped_sub_text = sub_message; |
| 122 | 114 |
| 123 if (main_message_hint == blink::WebTextDirectionLeftToRight) { | 115 if (main_message_hint == blink::WebTextDirectionLeftToRight) { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 148 | 140 |
| 149 blink::WebString WebViewTestClient::acceptLanguages() { | 141 blink::WebString WebViewTestClient::acceptLanguages() { |
| 150 return blink::WebString::fromUTF8(test_runner_->GetAcceptLanguages()); | 142 return blink::WebString::fromUTF8(test_runner_->GetAcceptLanguages()); |
| 151 } | 143 } |
| 152 | 144 |
| 153 WebTestDelegate* WebViewTestClient::delegate() { | 145 WebTestDelegate* WebViewTestClient::delegate() { |
| 154 return web_test_proxy_base_->delegate(); | 146 return web_test_proxy_base_->delegate(); |
| 155 } | 147 } |
| 156 | 148 |
| 157 } // namespace test_runner | 149 } // namespace test_runner |
| OLD | NEW |