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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/strings/string_tokenizer.h" | 9 #include "base/strings/string_tokenizer.h" |
10 #include "mojo/application/application_runner_chromium.h" | 10 #include "mojo/application/application_runner_chromium.h" |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 Shell* shell_; | 206 Shell* shell_; |
207 | 207 |
208 DISALLOW_COPY_AND_ASSIGN(ContentHandlerImpl); | 208 DISALLOW_COPY_AND_ASSIGN(ContentHandlerImpl); |
209 }; | 209 }; |
210 | 210 |
211 class PNGViewer : public ApplicationDelegate { | 211 class PNGViewer : public ApplicationDelegate { |
212 public: | 212 public: |
213 PNGViewer() {} | 213 PNGViewer() {} |
214 private: | 214 private: |
215 // Overridden from ApplicationDelegate: | 215 // Overridden from ApplicationDelegate: |
216 virtual void Initialize(ApplicationImpl* app) MOJO_OVERRIDE { | 216 virtual void Initialize(ApplicationImpl* app) override { |
217 content_handler_factory_.reset( | 217 content_handler_factory_.reset( |
218 new InterfaceFactoryImplWithContext<ContentHandlerImpl, Shell>( | 218 new InterfaceFactoryImplWithContext<ContentHandlerImpl, Shell>( |
219 app->shell())); | 219 app->shell())); |
220 } | 220 } |
221 | 221 |
222 // Overridden from ApplicationDelegate: | 222 // Overridden from ApplicationDelegate: |
223 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) | 223 virtual bool ConfigureIncomingConnection( |
224 MOJO_OVERRIDE { | 224 ApplicationConnection* connection) override { |
225 connection->AddService(content_handler_factory_.get()); | 225 connection->AddService(content_handler_factory_.get()); |
226 return true; | 226 return true; |
227 } | 227 } |
228 | 228 |
229 scoped_ptr<InterfaceFactoryImplWithContext<ContentHandlerImpl, Shell> > | 229 scoped_ptr<InterfaceFactoryImplWithContext<ContentHandlerImpl, Shell> > |
230 content_handler_factory_; | 230 content_handler_factory_; |
231 | 231 |
232 DISALLOW_COPY_AND_ASSIGN(PNGViewer); | 232 DISALLOW_COPY_AND_ASSIGN(PNGViewer); |
233 }; | 233 }; |
234 | 234 |
235 } // namespace examples | 235 } // namespace examples |
236 } // namespace mojo | 236 } // namespace mojo |
237 | 237 |
238 MojoResult MojoMain(MojoHandle shell_handle) { | 238 MojoResult MojoMain(MojoHandle shell_handle) { |
239 mojo::ApplicationRunnerChromium runner(new mojo::examples::PNGViewer); | 239 mojo::ApplicationRunnerChromium runner(new mojo::examples::PNGViewer); |
240 return runner.Run(shell_handle); | 240 return runner.Run(shell_handle); |
241 } | 241 } |
OLD | NEW |