OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_test_proxy.h" | 5 #include "components/test_runner/web_test_proxy.h" |
6 | 6 |
7 #include <cctype> | 7 #include <cctype> |
8 | 8 |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1401 } | 1401 } |
1402 } | 1402 } |
1403 | 1403 |
1404 void WebTestProxyBase::ResetInputMethod() { | 1404 void WebTestProxyBase::ResetInputMethod() { |
1405 // If a composition text exists, then we need to let the browser process | 1405 // If a composition text exists, then we need to let the browser process |
1406 // to cancel the input method's ongoing composition session. | 1406 // to cancel the input method's ongoing composition session. |
1407 if (web_widget_) | 1407 if (web_widget_) |
1408 web_widget_->confirmComposition(); | 1408 web_widget_->confirmComposition(); |
1409 } | 1409 } |
1410 | 1410 |
| 1411 void WebTestProxyBase::CheckIfAudioSinkExistsAndIsAuthorized( |
| 1412 const blink::WebString& sink_id, |
| 1413 const blink::WebSecurityOrigin& security_origin, |
| 1414 blink::WebSetSinkIdCallbacks* web_callbacks) { |
| 1415 scoped_ptr<blink::WebSetSinkIdCallbacks> callback(web_callbacks); |
| 1416 std::string device_id = sink_id.utf8(); |
| 1417 if (device_id == "valid" || device_id.empty()) |
| 1418 callback->onSuccess(); |
| 1419 else if (device_id == "unauthorized") |
| 1420 callback->onError(blink::WebSetSinkIdError::NotAuthorized); |
| 1421 else |
| 1422 callback->onError(blink::WebSetSinkIdError::NotFound); |
| 1423 } |
| 1424 |
1411 blink::WebString WebTestProxyBase::acceptLanguages() { | 1425 blink::WebString WebTestProxyBase::acceptLanguages() { |
1412 return blink::WebString::fromUTF8(accept_languages_); | 1426 return blink::WebString::fromUTF8(accept_languages_); |
1413 } | 1427 } |
1414 | 1428 |
1415 } // namespace test_runner | 1429 } // namespace test_runner |
OLD | NEW |