| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 base::UTF16ToUTF8(wrapped_main_text) + | 172 base::UTF16ToUTF8(wrapped_main_text) + |
| 173 " sub-message=" + | 173 " sub-message=" + |
| 174 base::UTF16ToUTF8(wrapped_sub_text) + "\n"); | 174 base::UTF16ToUTF8(wrapped_sub_text) + "\n"); |
| 175 } | 175 } |
| 176 | 176 |
| 177 blink::WebSpeechRecognizer* WebViewTestClient::speechRecognizer() { | 177 blink::WebSpeechRecognizer* WebViewTestClient::speechRecognizer() { |
| 178 return test_runner_->getMockWebSpeechRecognizer(); | 178 return test_runner_->getMockWebSpeechRecognizer(); |
| 179 } | 179 } |
| 180 | 180 |
| 181 bool WebViewTestClient::requestPointerLock() { | 181 bool WebViewTestClient::requestPointerLock() { |
| 182 return test_runner_->RequestPointerLock(); | 182 return web_test_proxy_base_->view_test_runner()->RequestPointerLock(); |
| 183 } | 183 } |
| 184 | 184 |
| 185 void WebViewTestClient::requestPointerUnlock() { | 185 void WebViewTestClient::requestPointerUnlock() { |
| 186 test_runner_->RequestPointerUnlock(); | 186 web_test_proxy_base_->view_test_runner()->RequestPointerUnlock(); |
| 187 } | 187 } |
| 188 | 188 |
| 189 bool WebViewTestClient::isPointerLocked() { | 189 bool WebViewTestClient::isPointerLocked() { |
| 190 return test_runner_->isPointerLocked(); | 190 return web_test_proxy_base_->view_test_runner()->isPointerLocked(); |
| 191 } | 191 } |
| 192 | 192 |
| 193 void WebViewTestClient::didFocus() { | 193 void WebViewTestClient::didFocus() { |
| 194 test_runner_->SetFocus(web_test_proxy_base_->web_view(), true); | 194 test_runner_->SetFocus(web_test_proxy_base_->web_view(), true); |
| 195 } | 195 } |
| 196 | 196 |
| 197 void WebViewTestClient::setToolTipText(const blink::WebString& text, | 197 void WebViewTestClient::setToolTipText(const blink::WebString& text, |
| 198 blink::WebTextDirection direction) { | 198 blink::WebTextDirection direction) { |
| 199 test_runner_->setToolTipText(text); | 199 test_runner_->setToolTipText(text); |
| 200 } | 200 } |
| 201 | 201 |
| 202 void WebViewTestClient::resetInputMethod() { | 202 void WebViewTestClient::resetInputMethod() { |
| 203 // If a composition text exists, then we need to let the browser process | 203 // If a composition text exists, then we need to let the browser process |
| 204 // to cancel the input method's ongoing composition session. | 204 // to cancel the input method's ongoing composition session. |
| 205 if (web_test_proxy_base_) | 205 if (web_test_proxy_base_) |
| 206 web_test_proxy_base_->web_widget()->confirmComposition(); | 206 web_test_proxy_base_->web_widget()->confirmComposition(); |
| 207 } | 207 } |
| 208 | 208 |
| 209 blink::WebString WebViewTestClient::acceptLanguages() { | 209 blink::WebString WebViewTestClient::acceptLanguages() { |
| 210 return blink::WebString::fromUTF8(test_runner_->GetAcceptLanguages()); | 210 return blink::WebString::fromUTF8(test_runner_->GetAcceptLanguages()); |
| 211 } | 211 } |
| 212 | 212 |
| 213 WebTestDelegate* WebViewTestClient::delegate() { | 213 WebTestDelegate* WebViewTestClient::delegate() { |
| 214 return web_test_proxy_base_->delegate(); | 214 return web_test_proxy_base_->delegate(); |
| 215 } | 215 } |
| 216 | 216 |
| 217 } // namespace test_runner | 217 } // namespace test_runner |
| OLD | NEW |