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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 public: | 65 public: |
66 CaptureCallback(const base::Callback<void(const SkBitmap&)>& callback); | 66 CaptureCallback(const base::Callback<void(const SkBitmap&)>& callback); |
67 virtual ~CaptureCallback(); | 67 virtual ~CaptureCallback(); |
68 | 68 |
69 void set_wait_for_popup(bool wait) { wait_for_popup_ = wait; } | 69 void set_wait_for_popup(bool wait) { wait_for_popup_ = wait; } |
70 void set_popup_position(const gfx::Point& position) { | 70 void set_popup_position(const gfx::Point& position) { |
71 popup_position_ = position; | 71 popup_position_ = position; |
72 } | 72 } |
73 | 73 |
74 // WebCompositeAndReadbackAsyncCallback implementation. | 74 // WebCompositeAndReadbackAsyncCallback implementation. |
75 virtual void didCompositeAndReadback(const SkBitmap& bitmap); | 75 void didCompositeAndReadback(const SkBitmap& bitmap) override; |
76 | 76 |
77 private: | 77 private: |
78 base::Callback<void(const SkBitmap&)> callback_; | 78 base::Callback<void(const SkBitmap&)> callback_; |
79 SkBitmap main_bitmap_; | 79 SkBitmap main_bitmap_; |
80 bool wait_for_popup_; | 80 bool wait_for_popup_; |
81 gfx::Point popup_position_; | 81 gfx::Point popup_position_; |
82 }; | 82 }; |
83 | 83 |
84 class LayoutAndPaintCallback : public blink::WebLayoutAndPaintAsyncCallback { | 84 class LayoutAndPaintCallback : public blink::WebLayoutAndPaintAsyncCallback { |
85 public: | 85 public: |
86 LayoutAndPaintCallback(const base::Closure& callback) | 86 LayoutAndPaintCallback(const base::Closure& callback) |
87 : callback_(callback), wait_for_popup_(false) { | 87 : callback_(callback), wait_for_popup_(false) { |
88 } | 88 } |
89 virtual ~LayoutAndPaintCallback() { | 89 virtual ~LayoutAndPaintCallback() { |
90 } | 90 } |
91 | 91 |
92 void set_wait_for_popup(bool wait) { wait_for_popup_ = wait; } | 92 void set_wait_for_popup(bool wait) { wait_for_popup_ = wait; } |
93 | 93 |
94 // WebLayoutAndPaintAsyncCallback implementation. | 94 // WebLayoutAndPaintAsyncCallback implementation. |
95 virtual void didLayoutAndPaint(); | 95 void didLayoutAndPaint() override; |
96 | 96 |
97 private: | 97 private: |
98 base::Closure callback_; | 98 base::Closure callback_; |
99 bool wait_for_popup_; | 99 bool wait_for_popup_; |
100 }; | 100 }; |
101 | 101 |
102 class HostMethodTask : public WebMethodTask<WebTestProxyBase> { | 102 class HostMethodTask : public WebMethodTask<WebTestProxyBase> { |
103 public: | 103 public: |
104 typedef void (WebTestProxyBase::*CallbackMethodType)(); | 104 typedef void (WebTestProxyBase::*CallbackMethodType)(); |
105 HostMethodTask(WebTestProxyBase* object, CallbackMethodType callback) | 105 HostMethodTask(WebTestProxyBase* object, CallbackMethodType callback) |
(...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1416 // to cancel the input method's ongoing composition session. | 1416 // to cancel the input method's ongoing composition session. |
1417 if (web_widget_) | 1417 if (web_widget_) |
1418 web_widget_->confirmComposition(); | 1418 web_widget_->confirmComposition(); |
1419 } | 1419 } |
1420 | 1420 |
1421 blink::WebString WebTestProxyBase::acceptLanguages() { | 1421 blink::WebString WebTestProxyBase::acceptLanguages() { |
1422 return blink::WebString::fromUTF8(accept_languages_); | 1422 return blink::WebString::fromUTF8(accept_languages_); |
1423 } | 1423 } |
1424 | 1424 |
1425 } // namespace test_runner | 1425 } // namespace test_runner |
OLD | NEW |