| 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/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/string_tokenizer.h" | 10 #include "base/strings/string_tokenizer.h" |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 }; | 194 }; |
| 195 | 195 |
| 196 class ContentHandlerImpl : public InterfaceImpl<ContentHandler> { | 196 class ContentHandlerImpl : public InterfaceImpl<ContentHandler> { |
| 197 public: | 197 public: |
| 198 explicit ContentHandlerImpl(Shell* shell) : shell_(shell) {} | 198 explicit ContentHandlerImpl(Shell* shell) : shell_(shell) {} |
| 199 virtual ~ContentHandlerImpl() {} | 199 virtual ~ContentHandlerImpl() {} |
| 200 | 200 |
| 201 private: | 201 private: |
| 202 // Overridden from ContentHandler: | 202 // Overridden from ContentHandler: |
| 203 virtual void OnConnect( | 203 virtual void OnConnect( |
| 204 const mojo::String& url, | 204 const mojo::String& requestor_url, |
| 205 URLResponsePtr response, | 205 URLResponsePtr response, |
| 206 InterfaceRequest<ServiceProvider> service_provider) override { | 206 InterfaceRequest<ServiceProvider> service_provider) override { |
| 207 ServiceProviderImpl* exported_services = new ServiceProviderImpl(); | 207 ServiceProviderImpl* exported_services = new ServiceProviderImpl(); |
| 208 BindToRequest(exported_services, &service_provider); | 208 BindToRequest(exported_services, &service_provider); |
| 209 scoped_ptr<ServiceProvider> remote( | 209 scoped_ptr<ServiceProvider> remote( |
| 210 exported_services->CreateRemoteServiceProvider()); | 210 exported_services->CreateRemoteServiceProvider()); |
| 211 PNGView::Spawn(response.Pass(), exported_services, remote.Pass(), shell_); | 211 PNGView::Spawn(response.Pass(), exported_services, remote.Pass(), shell_); |
| 212 } | 212 } |
| 213 | 213 |
| 214 Shell* shell_; | 214 Shell* shell_; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 240 DISALLOW_COPY_AND_ASSIGN(PNGViewer); | 240 DISALLOW_COPY_AND_ASSIGN(PNGViewer); |
| 241 }; | 241 }; |
| 242 | 242 |
| 243 } // namespace examples | 243 } // namespace examples |
| 244 } // namespace mojo | 244 } // namespace mojo |
| 245 | 245 |
| 246 MojoResult MojoMain(MojoHandle shell_handle) { | 246 MojoResult MojoMain(MojoHandle shell_handle) { |
| 247 mojo::ApplicationRunnerChromium runner(new mojo::examples::PNGViewer); | 247 mojo::ApplicationRunnerChromium runner(new mojo::examples::PNGViewer); |
| 248 return runner.Run(shell_handle); | 248 return runner.Run(shell_handle); |
| 249 } | 249 } |
| OLD | NEW |