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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <cctype> | 10 #include <cctype> |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 base::Unretained(this), callback)); | 666 base::Unretained(this), callback)); |
667 return; | 667 return; |
668 } | 668 } |
669 | 669 |
670 CaptureCallback* capture_callback = new CaptureCallback(base::Bind( | 670 CaptureCallback* capture_callback = new CaptureCallback(base::Bind( |
671 &WebTestProxyBase::DidCapturePixelsAsync, base::Unretained(this), | 671 &WebTestProxyBase::DidCapturePixelsAsync, base::Unretained(this), |
672 callback)); | 672 callback)); |
673 web_widget_->compositeAndReadbackAsync(capture_callback); | 673 web_widget_->compositeAndReadbackAsync(capture_callback); |
674 if (blink::WebPagePopup* popup = web_widget_->pagePopup()) { | 674 if (blink::WebPagePopup* popup = web_widget_->pagePopup()) { |
675 capture_callback->set_wait_for_popup(true); | 675 capture_callback->set_wait_for_popup(true); |
676 capture_callback->set_popup_position(popup->positionRelativeToOwner()); | 676 capture_callback->set_popup_position( |
| 677 delegate_->ConvertDIPToNative(popup->positionRelativeToOwner())); |
677 popup->compositeAndReadbackAsync(capture_callback); | 678 popup->compositeAndReadbackAsync(capture_callback); |
678 } | 679 } |
679 } | 680 } |
680 | 681 |
681 void WebTestProxyBase::DidCapturePixelsAsync( | 682 void WebTestProxyBase::DidCapturePixelsAsync( |
682 const base::Callback<void(const SkBitmap&)>& callback, | 683 const base::Callback<void(const SkBitmap&)>& callback, |
683 const SkBitmap& bitmap) { | 684 const SkBitmap& bitmap) { |
684 SkCanvas canvas(bitmap); | 685 SkCanvas canvas(bitmap); |
685 DrawSelectionRect(&canvas); | 686 DrawSelectionRect(&canvas); |
686 if (!callback.is_null()) | 687 if (!callback.is_null()) |
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1424 callback->onError(blink::WebSetSinkIdError::NotAuthorized); | 1425 callback->onError(blink::WebSetSinkIdError::NotAuthorized); |
1425 else | 1426 else |
1426 callback->onError(blink::WebSetSinkIdError::NotFound); | 1427 callback->onError(blink::WebSetSinkIdError::NotFound); |
1427 } | 1428 } |
1428 | 1429 |
1429 blink::WebString WebTestProxyBase::acceptLanguages() { | 1430 blink::WebString WebTestProxyBase::acceptLanguages() { |
1430 return blink::WebString::fromUTF8(accept_languages_); | 1431 return blink::WebString::fromUTF8(accept_languages_); |
1431 } | 1432 } |
1432 | 1433 |
1433 } // namespace test_runner | 1434 } // namespace test_runner |
OLD | NEW |