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 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 base::Unretained(this), callback)); | 663 base::Unretained(this), callback)); |
664 return; | 664 return; |
665 } | 665 } |
666 | 666 |
667 CaptureCallback* capture_callback = new CaptureCallback(base::Bind( | 667 CaptureCallback* capture_callback = new CaptureCallback(base::Bind( |
668 &WebTestProxyBase::DidCapturePixelsAsync, base::Unretained(this), | 668 &WebTestProxyBase::DidCapturePixelsAsync, base::Unretained(this), |
669 callback)); | 669 callback)); |
670 web_widget_->compositeAndReadbackAsync(capture_callback); | 670 web_widget_->compositeAndReadbackAsync(capture_callback); |
671 if (blink::WebPagePopup* popup = web_widget_->pagePopup()) { | 671 if (blink::WebPagePopup* popup = web_widget_->pagePopup()) { |
672 capture_callback->set_wait_for_popup(true); | 672 capture_callback->set_wait_for_popup(true); |
673 capture_callback->set_popup_position(popup->positionRelativeToOwner()); | 673 capture_callback->set_popup_position( |
| 674 delegate_->ConvertDIPToNative(popup->positionRelativeToOwner())); |
674 popup->compositeAndReadbackAsync(capture_callback); | 675 popup->compositeAndReadbackAsync(capture_callback); |
675 } | 676 } |
676 } | 677 } |
677 | 678 |
678 void WebTestProxyBase::DidCapturePixelsAsync( | 679 void WebTestProxyBase::DidCapturePixelsAsync( |
679 const base::Callback<void(const SkBitmap&)>& callback, | 680 const base::Callback<void(const SkBitmap&)>& callback, |
680 const SkBitmap& bitmap) { | 681 const SkBitmap& bitmap) { |
681 SkCanvas canvas(bitmap); | 682 SkCanvas canvas(bitmap); |
682 DrawSelectionRect(&canvas); | 683 DrawSelectionRect(&canvas); |
683 if (!callback.is_null()) | 684 if (!callback.is_null()) |
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1420 callback->onError(blink::WebSetSinkIdError::NotAuthorized); | 1421 callback->onError(blink::WebSetSinkIdError::NotAuthorized); |
1421 else | 1422 else |
1422 callback->onError(blink::WebSetSinkIdError::NotFound); | 1423 callback->onError(blink::WebSetSinkIdError::NotFound); |
1423 } | 1424 } |
1424 | 1425 |
1425 blink::WebString WebTestProxyBase::acceptLanguages() { | 1426 blink::WebString WebTestProxyBase::acceptLanguages() { |
1426 return blink::WebString::fromUTF8(accept_languages_); | 1427 return blink::WebString::fromUTF8(accept_languages_); |
1427 } | 1428 } |
1428 | 1429 |
1429 } // namespace test_runner | 1430 } // namespace test_runner |
OLD | NEW |