OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "mandoline/ui/aura/surface_binding.h" | 5 #include "mandoline/ui/aura/surface_binding.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 delete view_map; | 198 delete view_map; |
199 view_states.Pointer()->Set(nullptr); | 199 view_states.Pointer()->Set(nullptr); |
200 } | 200 } |
201 } | 201 } |
202 | 202 |
203 void SurfaceBinding::PerViewManagerState::Init() { | 203 void SurfaceBinding::PerViewManagerState::Init() { |
204 DCHECK(!surface_.get()); | 204 DCHECK(!surface_.get()); |
205 | 205 |
206 mojo::ServiceProviderPtr surfaces_service_provider; | 206 mojo::ServiceProviderPtr surfaces_service_provider; |
207 mojo::URLRequestPtr request(mojo::URLRequest::New()); | 207 mojo::URLRequestPtr request(mojo::URLRequest::New()); |
208 request->url = mojo::String::From("mojo:surfaces_service"); | 208 request->url = mojo::String::From("mojo:view_manager"); |
209 shell_->ConnectToApplication(request.Pass(), | 209 shell_->ConnectToApplication(request.Pass(), |
210 GetProxy(&surfaces_service_provider), | 210 GetProxy(&surfaces_service_provider), |
211 nullptr, | 211 nullptr, |
212 nullptr); | 212 nullptr); |
213 ConnectToService(surfaces_service_provider.get(), &surface_); | 213 ConnectToService(surfaces_service_provider.get(), &surface_); |
214 surface_->GetIdNamespace( | 214 surface_->GetIdNamespace( |
215 base::Bind(&SurfaceBinding::PerViewManagerState::SetIdNamespace, | 215 base::Bind(&SurfaceBinding::PerViewManagerState::SetIdNamespace, |
216 base::Unretained(this))); | 216 base::Unretained(this))); |
217 // Block until we receive our id namespace. | 217 // Block until we receive our id namespace. |
218 surface_.WaitForIncomingResponse(); | 218 surface_.WaitForIncomingResponse(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 } | 250 } |
251 | 251 |
252 SurfaceBinding::~SurfaceBinding() { | 252 SurfaceBinding::~SurfaceBinding() { |
253 } | 253 } |
254 | 254 |
255 scoped_ptr<cc::OutputSurface> SurfaceBinding::CreateOutputSurface() { | 255 scoped_ptr<cc::OutputSurface> SurfaceBinding::CreateOutputSurface() { |
256 return state_->CreateOutputSurface(view_); | 256 return state_->CreateOutputSurface(view_); |
257 } | 257 } |
258 | 258 |
259 } // namespace mandoline | 259 } // namespace mandoline |
OLD | NEW |