blob: d4750385d0790970b49e5f5c5ec5388f913003bc (
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
|
// 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.
#include "components/html_viewer/html_viewer.h"
#include <utility>
#include "components/html_viewer/content_handler_impl.h"
#include "components/html_viewer/global_state.h"
#include "mojo/shell/public/cpp/application_connection.h"
namespace html_viewer {
HTMLViewer::HTMLViewer() : shell_(nullptr) {
}
HTMLViewer::~HTMLViewer() {
}
void HTMLViewer::Initialize(mojo::Shell* shell, const std::string& url,
uint32_t id) {
shell_ = shell;
global_state_.reset(new GlobalState(shell, url));
}
bool HTMLViewer::AcceptConnection(
mojo::ApplicationConnection* connection) {
connection->AddService(this);
return true;
}
void HTMLViewer::Create(
mojo::ApplicationConnection* connection,
mojo::InterfaceRequest<mojo::shell::mojom::ContentHandler> request) {
new ContentHandlerImpl(global_state_.get(), shell_, std::move(request));
}
} // namespace html_viewer
|