summaryrefslogtreecommitdiffstats
path: root/components/html_viewer/layout_test_content_handler_impl.h
blob: 0113783fed8bc74cc4751ed8c558a090ee536fc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_HTML_VIEWER_LAYOUT_TEST_CONTENT_HANDLER_IMPL_H_
#define COMPONENTS_HTML_VIEWER_LAYOUT_TEST_CONTENT_HANDLER_IMPL_H_

#include "components/html_viewer/content_handler_impl.h"
#include "components/html_viewer/html_factory.h"
#include "components/test_runner/web_test_proxy.h"

namespace blink {
class WebView;
}

namespace test_runner {
class WebTestInterfaces;
}

namespace html_viewer {

class WebTestDelegateImpl;

class LayoutTestContentHandlerImpl : public ContentHandlerImpl,
                                     public HTMLFactory {
 public:
  LayoutTestContentHandlerImpl(GlobalState* global_state,
                               mojo::ApplicationImpl* app,
                               mojo::InterfaceRequest<ContentHandler> request,
                               test_runner::WebTestInterfaces* test_interfaces,
                               WebTestDelegateImpl* test_delegate);
  ~LayoutTestContentHandlerImpl() override;

 private:
  using WebWidgetProxy =
      test_runner::WebTestProxy<HTMLWidgetRootLocal,
                                HTMLWidgetRootLocal::CreateParams*>;

  // ContentHandler:
  void StartApplication(mojo::InterfaceRequest<mojo::Application> request,
                        mojo::URLResponsePtr response) override;

  // HTMLFactory
  HTMLFrame* CreateHTMLFrame(HTMLFrame::CreateParams* params) override;
  HTMLWidgetRootLocal* CreateHTMLWidgetRootLocal(
      HTMLWidgetRootLocal::CreateParams* params) override;

  test_runner::WebTestInterfaces* test_interfaces_;
  WebTestDelegateImpl* test_delegate_;
  WebWidgetProxy* web_widget_proxy_;

  DISALLOW_COPY_AND_ASSIGN(LayoutTestContentHandlerImpl);
};

}  // namespace html_viewer

#endif  // COMPONENTS_HTML_VIEWER_LAYOUT_TEST_CONTENT_HANDLER_IMPL_H_