Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Side by Side Diff: components/test_runner/web_view_test_client.h

Issue 1840823002: Extract WebViewClient implementation out of WebTestProxyBase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@separate-pixel-dump-code
Patch Set: Expanding a comment + an IWYU fix. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_TEST_RUNNER_WEB_VIEW_TEST_CLIENT_H_
6 #define COMPONENTS_TEST_RUNNER_WEB_VIEW_TEST_CLIENT_H_
7
8 #include "base/macros.h"
9 #include "components/test_runner/web_task.h"
10 #include "third_party/WebKit/public/web/WebViewClient.h"
11
12 namespace blink {
13 class WebView;
14 } // namespace blink
15
16 namespace test_runner {
17
18 class EventSender;
19 class TestRunner;
20 class WebTestDelegate;
21 class WebTestProxyBase;
22
23 // WebViewTestClient implements WebViewClient interface, providing behavior
24 // expected by tests. WebViewTestClient ends up used by WebTestProxy
25 // which coordinates forwarding WebViewClient calls either to
26 // WebViewTestClient or to the product code (i.e. to RenderViewImpl).
27 class WebViewTestClient : public blink::WebViewClient {
28 public:
29 // Caller has to ensure that all arguments (i.e. |test_runner| and |delegate|)
30 // live longer than |this|.
31 WebViewTestClient(TestRunner* test_runner,
32 WebTestDelegate* delegate,
33 EventSender* event_sender,
34 WebTestProxyBase* web_test_proxy_base);
35
36 virtual ~WebViewTestClient();
37
38 // WebViewClient overrides needed by WebTestProxy.
39 void showValidationMessage(const blink::WebRect& anchor_in_root_view,
40 const blink::WebString& main_message,
41 blink::WebTextDirection main_message_hint,
42 const blink::WebString& sub_message,
43 blink::WebTextDirection sub_message_hint) override;
44 bool runFileChooser(const blink::WebFileChooserParams& params,
45 blink::WebFileChooserCompletion* completion) override;
46 void scheduleAnimation() override;
47 void startDragging(blink::WebLocalFrame* frame,
48 const blink::WebDragData& data,
49 blink::WebDragOperationsMask mask,
50 const blink::WebImage& image,
51 const blink::WebPoint& point) override;
52 void didChangeContents() override;
53 blink::WebView* createView(blink::WebLocalFrame* creator,
54 const blink::WebURLRequest& request,
55 const blink::WebWindowFeatures& features,
56 const blink::WebString& frame_name,
57 blink::WebNavigationPolicy policy,
58 bool suppress_opener) override;
59 void setStatusText(const blink::WebString& text) override;
60 void printPage(blink::WebLocalFrame* frame) override;
61 blink::WebSpeechRecognizer* speechRecognizer() override;
62 bool requestPointerLock() override;
63 void requestPointerUnlock() override;
64 bool isPointerLocked() override;
65 void didFocus() override;
66 void setToolTipText(const blink::WebString& text,
67 blink::WebTextDirection direction) override;
68 void resetInputMethod() override;
69 blink::WebString acceptLanguages() override;
70
71 // Members expected by WebTask-related templates.
72 WebTaskList* mutable_task_list() { return &task_list_; }
73
74 private:
75 void AnimateNow();
76
77 // Borrowed pointers to other parts of Layout Tests state.
78 TestRunner* test_runner_;
79 WebTestDelegate* delegate_;
80 EventSender* event_sender_;
81 WebTestProxyBase* web_test_proxy_base_;
82
83 bool animation_scheduled_;
84
85 WebTaskList task_list_;
86
87 DISALLOW_COPY_AND_ASSIGN(WebViewTestClient);
88 };
89
90 } // namespace test_runner
91
92 #endif // COMPONENTS_TEST_RUNNER_WEB_VIEW_TEST_CLIENT_H_
OLDNEW
« no previous file with comments | « components/test_runner/web_test_proxy.cc ('k') | components/test_runner/web_view_test_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698