| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 #include "components/html_viewer/html_viewer.h" | |
| 6 | |
| 7 #include <utility> | |
| 8 | |
| 9 #include "components/html_viewer/content_handler_impl.h" | |
| 10 #include "components/html_viewer/global_state.h" | |
| 11 #include "mojo/shell/public/cpp/connection.h" | |
| 12 | |
| 13 namespace html_viewer { | |
| 14 | |
| 15 HTMLViewer::HTMLViewer() : shell_(nullptr) { | |
| 16 } | |
| 17 | |
| 18 HTMLViewer::~HTMLViewer() { | |
| 19 } | |
| 20 | |
| 21 void HTMLViewer::Initialize(mojo::Shell* shell, const std::string& url, | |
| 22 uint32_t id) { | |
| 23 shell_ = shell; | |
| 24 global_state_.reset(new GlobalState(shell, url)); | |
| 25 } | |
| 26 | |
| 27 bool HTMLViewer::AcceptConnection(mojo::Connection* connection) { | |
| 28 connection->AddService(this); | |
| 29 return true; | |
| 30 } | |
| 31 | |
| 32 void HTMLViewer::Create( | |
| 33 mojo::Connection* connection, | |
| 34 mojo::InterfaceRequest<mojo::shell::mojom::ContentHandler> request) { | |
| 35 new ContentHandlerImpl(global_state_.get(), shell_, std::move(request)); | |
| 36 } | |
| 37 | |
| 38 } // namespace html_viewer | |
| OLD | NEW |