1 // Copyright 2015 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.
5 #include "components/html_viewer/html_viewer.h"
7 #include "components/html_viewer/content_handler_impl.h"
8 #include "components/html_viewer/global_state.h"
9 #include "mojo/application/public/cpp/application_connection.h"
12 namespace html_viewer
{
14 HTMLViewer::HTMLViewer() : app_(nullptr) {
17 HTMLViewer::~HTMLViewer() {
20 void HTMLViewer::Initialize(mojo::ApplicationImpl
* app
) {
22 global_state_
.reset(new GlobalState(app
));
25 bool HTMLViewer::ConfigureIncomingConnection(
26 mojo::ApplicationConnection
* connection
) {
27 connection
->AddService(this);
31 void HTMLViewer::Create(
32 mojo::ApplicationConnection
* connection
,
33 mojo::InterfaceRequest
<mojo::ContentHandler
> request
) {
34 new ContentHandlerImpl(global_state_
.get(), app_
, request
.Pass());
37 } // namespace html_viewer