| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "mojo/shell/context.h" | 5 #include "mojo/shell/context.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 public InterfaceFactory<NativeViewport>, | 127 public InterfaceFactory<NativeViewport>, |
| 128 public InterfaceFactory<Gpu> { | 128 public InterfaceFactory<Gpu> { |
| 129 public: | 129 public: |
| 130 NativeViewportApplicationLoader() : gpu_state_(new GpuImpl::State) {} | 130 NativeViewportApplicationLoader() : gpu_state_(new GpuImpl::State) {} |
| 131 virtual ~NativeViewportApplicationLoader() {} | 131 virtual ~NativeViewportApplicationLoader() {} |
| 132 | 132 |
| 133 private: | 133 private: |
| 134 // ApplicationLoader implementation. | 134 // ApplicationLoader implementation. |
| 135 virtual void Load(ApplicationManager* manager, | 135 virtual void Load(ApplicationManager* manager, |
| 136 const GURL& url, | 136 const GURL& url, |
| 137 scoped_refptr<LoadCallbacks> callbacks) override { | 137 ScopedMessagePipeHandle shell_handle, |
| 138 ScopedMessagePipeHandle shell_handle = callbacks->RegisterApplication(); | 138 LoadCallback callback) override { |
| 139 if (shell_handle.is_valid()) | 139 DCHECK(shell_handle.is_valid()); |
| 140 app_.reset(new ApplicationImpl(this, shell_handle.Pass())); | 140 app_.reset(new ApplicationImpl(this, shell_handle.Pass())); |
| 141 } | 141 } |
| 142 | 142 |
| 143 virtual void OnApplicationError(ApplicationManager* manager, | 143 virtual void OnApplicationError(ApplicationManager* manager, |
| 144 const GURL& url) override {} | 144 const GURL& url) override {} |
| 145 | 145 |
| 146 // ApplicationDelegate implementation. | 146 // ApplicationDelegate implementation. |
| 147 virtual bool ConfigureIncomingConnection( | 147 virtual bool ConfigureIncomingConnection( |
| 148 mojo::ApplicationConnection* connection) override { | 148 mojo::ApplicationConnection* connection) override { |
| 149 connection->AddService<NativeViewport>(this); | 149 connection->AddService<NativeViewport>(this); |
| 150 connection->AddService<Gpu>(this); | 150 connection->AddService<Gpu>(this); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 ScopedMessagePipeHandle Context::ConnectToServiceByName( | 292 ScopedMessagePipeHandle Context::ConnectToServiceByName( |
| 293 const GURL& application_url, | 293 const GURL& application_url, |
| 294 const std::string& service_name) { | 294 const std::string& service_name) { |
| 295 app_urls_.insert(application_url); | 295 app_urls_.insert(application_url); |
| 296 return application_manager_.ConnectToServiceByName( | 296 return application_manager_.ConnectToServiceByName( |
| 297 application_url, service_name).Pass(); | 297 application_url, service_name).Pass(); |
| 298 } | 298 } |
| 299 | 299 |
| 300 } // namespace shell | 300 } // namespace shell |
| 301 } // namespace mojo | 301 } // namespace mojo |
| OLD | NEW |