OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 Setup* setup_; | 123 Setup* setup_; |
124 mojo::StrongBinding<mojo::ContentHandler> binding_; | 124 mojo::StrongBinding<mojo::ContentHandler> binding_; |
125 | 125 |
126 DISALLOW_COPY_AND_ASSIGN(ContentHandlerImpl); | 126 DISALLOW_COPY_AND_ASSIGN(ContentHandlerImpl); |
127 }; | 127 }; |
128 | 128 |
129 class HTMLViewer : public mojo::ApplicationDelegate, | 129 class HTMLViewer : public mojo::ApplicationDelegate, |
130 public mojo::InterfaceFactory<ContentHandler> { | 130 public mojo::InterfaceFactory<ContentHandler> { |
131 public: | 131 public: |
132 HTMLViewer() {} | 132 HTMLViewer() {} |
133 ~HTMLViewer() override { blink::shutdown(); } | 133 ~HTMLViewer() override {} |
134 | 134 |
135 private: | 135 private: |
136 // Overridden from ApplicationDelegate: | 136 // Overridden from ApplicationDelegate: |
137 void Initialize(mojo::ApplicationImpl* app) override { | 137 void Initialize(mojo::ApplicationImpl* app) override { |
138 setup_.reset(new Setup(app)); | 138 setup_.reset(new Setup(app)); |
139 } | 139 } |
140 | 140 |
141 bool ConfigureIncomingConnection(ApplicationConnection* connection) override { | 141 bool ConfigureIncomingConnection(ApplicationConnection* connection) override { |
142 // If we're not being connected to from the view manager assume we're being | 142 // If we're not being connected to from the view manager assume we're being |
143 // run in tests, or a headless environment, in which case we'll never get a | 143 // run in tests, or a headless environment, in which case we'll never get a |
(...skipping 16 matching lines...) Expand all Loading... |
160 | 160 |
161 DISALLOW_COPY_AND_ASSIGN(HTMLViewer); | 161 DISALLOW_COPY_AND_ASSIGN(HTMLViewer); |
162 }; | 162 }; |
163 | 163 |
164 } // namespace html_viewer | 164 } // namespace html_viewer |
165 | 165 |
166 MojoResult MojoMain(MojoHandle shell_handle) { | 166 MojoResult MojoMain(MojoHandle shell_handle) { |
167 mojo::ApplicationRunner runner(new html_viewer::HTMLViewer); | 167 mojo::ApplicationRunner runner(new html_viewer::HTMLViewer); |
168 return runner.Run(shell_handle); | 168 return runner.Run(shell_handle); |
169 } | 169 } |
OLD | NEW |