| 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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 virtual bool ConfigureIncomingConnection( | 134 virtual bool ConfigureIncomingConnection( |
| 135 mojo::ApplicationConnection* connection) OVERRIDE { | 135 mojo::ApplicationConnection* connection) OVERRIDE { |
| 136 connection->AddService<NativeViewport>(this); | 136 connection->AddService<NativeViewport>(this); |
| 137 connection->AddService<Gpu>(this); | 137 connection->AddService<Gpu>(this); |
| 138 return true; | 138 return true; |
| 139 } | 139 } |
| 140 | 140 |
| 141 // InterfaceFactory<NativeViewport> implementation. | 141 // InterfaceFactory<NativeViewport> implementation. |
| 142 virtual void Create(ApplicationConnection* connection, | 142 virtual void Create(ApplicationConnection* connection, |
| 143 InterfaceRequest<NativeViewport> request) OVERRIDE { | 143 InterfaceRequest<NativeViewport> request) OVERRIDE { |
| 144 BindToRequest(new NativeViewportImpl, &request); | 144 SurfacesServicePtr surfaces_service; |
| 145 app_->ConnectToService("mojo:mojo_surfaces_service", &surfaces_service); |
| 146 GpuPtr gpu_service; |
| 147 // TODO(jamesr): Should be mojo_gpu_service |
| 148 app_->ConnectToService("mojo:mojo_native_viewport_service", &gpu_service); |
| 149 BindToRequest( |
| 150 new NativeViewportImpl(surfaces_service.Pass(), gpu_service.Pass()), |
| 151 &request); |
| 145 } | 152 } |
| 146 | 153 |
| 147 // InterfaceFactory<Gpu> implementation. | 154 // InterfaceFactory<Gpu> implementation. |
| 148 virtual void Create(ApplicationConnection* connection, | 155 virtual void Create(ApplicationConnection* connection, |
| 149 InterfaceRequest<Gpu> request) OVERRIDE { | 156 InterfaceRequest<Gpu> request) OVERRIDE { |
| 150 BindToRequest(new GpuImpl(share_group_.get(), mailbox_manager_.get()), | 157 BindToRequest(new GpuImpl(share_group_.get(), mailbox_manager_.get()), |
| 151 &request); | 158 &request); |
| 152 } | 159 } |
| 153 | 160 |
| 154 scoped_refptr<gfx::GLShareGroup> share_group_; | 161 scoped_refptr<gfx::GLShareGroup> share_group_; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 ScopedMessagePipeHandle Context::ConnectToServiceByName( | 269 ScopedMessagePipeHandle Context::ConnectToServiceByName( |
| 263 const GURL& application_url, | 270 const GURL& application_url, |
| 264 const std::string& service_name) { | 271 const std::string& service_name) { |
| 265 app_urls_.insert(application_url); | 272 app_urls_.insert(application_url); |
| 266 return application_manager_.ConnectToServiceByName( | 273 return application_manager_.ConnectToServiceByName( |
| 267 application_url, service_name).Pass(); | 274 application_url, service_name).Pass(); |
| 268 } | 275 } |
| 269 | 276 |
| 270 } // namespace shell | 277 } // namespace shell |
| 271 } // namespace mojo | 278 } // namespace mojo |
| OLD | NEW |