OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/arc/arc_bridge_host_impl.h" | 5 #include "components/arc/arc_bridge_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 | 181 |
182 void ArcBridgeHostImpl::OnTtsInstanceReady(mojom::TtsInstancePtr tts_ptr) { | 182 void ArcBridgeHostImpl::OnTtsInstanceReady(mojom::TtsInstancePtr tts_ptr) { |
183 OnInstanceReady(ArcBridgeService::Get()->tts(), std::move(tts_ptr)); | 183 OnInstanceReady(ArcBridgeService::Get()->tts(), std::move(tts_ptr)); |
184 } | 184 } |
185 | 185 |
186 void ArcBridgeHostImpl::OnVideoInstanceReady( | 186 void ArcBridgeHostImpl::OnVideoInstanceReady( |
187 mojom::VideoInstancePtr video_ptr) { | 187 mojom::VideoInstancePtr video_ptr) { |
188 OnInstanceReady(ArcBridgeService::Get()->video(), std::move(video_ptr)); | 188 OnInstanceReady(ArcBridgeService::Get()->video(), std::move(video_ptr)); |
189 } | 189 } |
190 | 190 |
| 191 void ArcBridgeHostImpl::OnWallpaperInstanceReady( |
| 192 mojom::WallpaperInstancePtr wallpaper_ptr) { |
| 193 OnInstanceReady(ArcBridgeService::Get()->wallpaper(), |
| 194 std::move(wallpaper_ptr)); |
| 195 } |
| 196 |
191 void ArcBridgeHostImpl::OnClosed() { | 197 void ArcBridgeHostImpl::OnClosed() { |
192 DCHECK(thread_checker_.CalledOnValidThread()); | 198 DCHECK(thread_checker_.CalledOnValidThread()); |
193 VLOG(1) << "Mojo connection lost"; | 199 VLOG(1) << "Mojo connection lost"; |
194 | 200 |
195 // Close all mojo channels. | 201 // Close all mojo channels. |
196 mojo_channels_.clear(); | 202 mojo_channels_.clear(); |
197 instance_.reset(); | 203 instance_.reset(); |
198 if (binding_.is_bound()) | 204 if (binding_.is_bound()) |
199 binding_.Close(); | 205 binding_.Close(); |
200 } | 206 } |
(...skipping 25 matching lines...) Expand all Loading... |
226 void ArcBridgeHostImpl::OnChannelClosed(MojoChannel* channel) { | 232 void ArcBridgeHostImpl::OnChannelClosed(MojoChannel* channel) { |
227 DCHECK(thread_checker_.CalledOnValidThread()); | 233 DCHECK(thread_checker_.CalledOnValidThread()); |
228 mojo_channels_.erase( | 234 mojo_channels_.erase( |
229 std::find_if(mojo_channels_.begin(), mojo_channels_.end(), | 235 std::find_if(mojo_channels_.begin(), mojo_channels_.end(), |
230 [channel](std::unique_ptr<MojoChannel>& ptr) { | 236 [channel](std::unique_ptr<MojoChannel>& ptr) { |
231 return ptr.get() == channel; | 237 return ptr.get() == channel; |
232 })); | 238 })); |
233 } | 239 } |
234 | 240 |
235 } // namespace arc | 241 } // namespace arc |
OLD | NEW |