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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 view_map->erase(connection_); | 116 view_map->erase(connection_); |
117 if (view_map->empty()) { | 117 if (view_map->empty()) { |
118 delete view_map; | 118 delete view_map; |
119 view_states.Pointer()->Set(nullptr); | 119 view_states.Pointer()->Set(nullptr); |
120 } | 120 } |
121 } | 121 } |
122 | 122 |
123 void SurfaceBinding::PerConnectionState::Init() { | 123 void SurfaceBinding::PerConnectionState::Init() { |
124 mojo::ServiceProviderPtr service_provider; | 124 mojo::ServiceProviderPtr service_provider; |
125 mojo::URLRequestPtr request(mojo::URLRequest::New()); | 125 mojo::URLRequestPtr request(mojo::URLRequest::New()); |
126 request->url = mojo::String::From("mojo:view_manager"); | 126 request->url = mojo::String::From("mojo:mus"); |
127 shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), | 127 shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), |
128 nullptr, nullptr, | 128 nullptr, nullptr, |
129 base::Bind(&OnGotContentHandlerID)); | 129 base::Bind(&OnGotContentHandlerID)); |
130 ConnectToService(service_provider.get(), &gpu_); | 130 ConnectToService(service_provider.get(), &gpu_); |
131 } | 131 } |
132 | 132 |
133 // SurfaceBinding -------------------------------------------------------------- | 133 // SurfaceBinding -------------------------------------------------------------- |
134 | 134 |
135 SurfaceBinding::SurfaceBinding(mojo::Shell* shell, mojo::View* view) | 135 SurfaceBinding::SurfaceBinding(mojo::Shell* shell, mojo::View* view) |
136 : view_(view), | 136 : view_(view), |
137 state_(PerConnectionState::Get(shell, view->connection())) { | 137 state_(PerConnectionState::Get(shell, view->connection())) { |
138 } | 138 } |
139 | 139 |
140 SurfaceBinding::~SurfaceBinding() { | 140 SurfaceBinding::~SurfaceBinding() { |
141 } | 141 } |
142 | 142 |
143 scoped_ptr<cc::OutputSurface> SurfaceBinding::CreateOutputSurface() { | 143 scoped_ptr<cc::OutputSurface> SurfaceBinding::CreateOutputSurface() { |
144 return state_->CreateOutputSurface(view_); | 144 return state_->CreateOutputSurface(view_); |
145 } | 145 } |
146 | 146 |
147 } // namespace mandoline | 147 } // namespace mandoline |
OLD | NEW |