| 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 #ifndef CONTENT_SHELL_TEST_RUNNER_WEB_VIEW_TEST_CLIENT_H_ | 5 #ifndef CONTENT_SHELL_TEST_RUNNER_WEB_VIEW_TEST_CLIENT_H_ |
| 6 #define CONTENT_SHELL_TEST_RUNNER_WEB_VIEW_TEST_CLIENT_H_ | 6 #define CONTENT_SHELL_TEST_RUNNER_WEB_VIEW_TEST_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "third_party/WebKit/public/web/WebViewClient.h" | 9 #include "third_party/WebKit/public/web/WebViewClient.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 class WebView; | 12 class WebView; |
| 13 } // namespace blink | 13 } // namespace blink |
| 14 | 14 |
| 15 namespace test_runner { | 15 namespace test_runner { |
| 16 | 16 |
| 17 class TestRunner; | 17 class TestRunner; |
| 18 class WebTestDelegate; | 18 class WebTestDelegate; |
| 19 class WebViewTestProxyBase; | 19 class WebViewTestProxyBase; |
| 20 | 20 |
| 21 // WebViewTestClient implements WebViewClient interface, providing behavior | 21 // WebViewTestClient implements WebViewClient interface, providing behavior |
| 22 // expected by tests. WebViewTestClient ends up used by WebViewTestProxy | 22 // expected by tests. WebViewTestClient ends up used by WebViewTestProxy |
| 23 // which coordinates forwarding WebViewClient calls either to | 23 // which coordinates forwarding WebViewClient calls either to |
| 24 // WebViewTestClient or to the product code (i.e. to RenderViewImpl). | 24 // WebViewTestClient or to the product code (i.e. to RenderViewImpl). |
| 25 class WebViewTestClient : public blink::WebViewClient { | 25 class WebViewTestClient : public blink::WebViewClient { |
| 26 public: | 26 public: |
| 27 // Caller has to ensure |web_view_test_proxy_base| lives longer than |this|. | 27 // Caller has to ensure |web_view_test_proxy_base| lives longer than |this|. |
| 28 WebViewTestClient(WebViewTestProxyBase* web_view_test_proxy_base); | 28 WebViewTestClient(WebViewTestProxyBase* web_view_test_proxy_base); |
| 29 | 29 |
| 30 virtual ~WebViewTestClient(); | 30 ~WebViewTestClient() override; |
| 31 | 31 |
| 32 // WebViewClient overrides needed by WebViewTestProxy. | 32 // WebViewClient overrides needed by WebViewTestProxy. |
| 33 void showValidationMessage(const blink::WebRect& anchor_in_root_view, | 33 void showValidationMessage(const blink::WebRect& anchor_in_root_view, |
| 34 const blink::WebString& main_message, | 34 const blink::WebString& main_message, |
| 35 blink::WebTextDirection main_message_hint, | 35 blink::WebTextDirection main_message_hint, |
| 36 const blink::WebString& sub_message, | 36 const blink::WebString& sub_message, |
| 37 blink::WebTextDirection sub_message_hint) override; | 37 blink::WebTextDirection sub_message_hint) override; |
| 38 void didChangeContents() override; | 38 void didChangeContents() override; |
| 39 blink::WebView* createView(blink::WebLocalFrame* creator, | 39 blink::WebView* createView(blink::WebLocalFrame* creator, |
| 40 const blink::WebURLRequest& request, | 40 const blink::WebURLRequest& request, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 54 | 54 |
| 55 // Borrowed pointer to WebViewTestProxyBase. | 55 // Borrowed pointer to WebViewTestProxyBase. |
| 56 WebViewTestProxyBase* web_view_test_proxy_base_; | 56 WebViewTestProxyBase* web_view_test_proxy_base_; |
| 57 | 57 |
| 58 DISALLOW_COPY_AND_ASSIGN(WebViewTestClient); | 58 DISALLOW_COPY_AND_ASSIGN(WebViewTestClient); |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 } // namespace test_runner | 61 } // namespace test_runner |
| 62 | 62 |
| 63 #endif // CONTENT_SHELL_TEST_RUNNER_WEB_VIEW_TEST_CLIENT_H_ | 63 #endif // CONTENT_SHELL_TEST_RUNNER_WEB_VIEW_TEST_CLIENT_H_ |
| OLD | NEW |