| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "ash/common/media_controller.h" | |
| 6 | |
| 7 namespace ash { | |
| 8 | |
| 9 MediaController::MediaController() {} | |
| 10 | |
| 11 MediaController::~MediaController() {} | |
| 12 | |
| 13 void MediaController::BindRequest(mojom::MediaControllerRequest request) { | |
| 14 bindings_.AddBinding(this, std::move(request)); | |
| 15 } | |
| 16 | |
| 17 void MediaController::AddObserver(MediaCaptureObserver* observer) { | |
| 18 observers_.AddObserver(observer); | |
| 19 } | |
| 20 | |
| 21 void MediaController::RemoveObserver(MediaCaptureObserver* observer) { | |
| 22 observers_.RemoveObserver(observer); | |
| 23 } | |
| 24 | |
| 25 void MediaController::HandleMediaNextTrack() { | |
| 26 if (client_) | |
| 27 client_->HandleMediaNextTrack(); | |
| 28 } | |
| 29 | |
| 30 void MediaController::HandleMediaPlayPause() { | |
| 31 if (client_) | |
| 32 client_->HandleMediaPlayPause(); | |
| 33 } | |
| 34 | |
| 35 void MediaController::HandleMediaPrevTrack() { | |
| 36 if (client_) | |
| 37 client_->HandleMediaPrevTrack(); | |
| 38 } | |
| 39 | |
| 40 void MediaController::RequestCaptureState() { | |
| 41 if (client_) | |
| 42 client_->RequestCaptureState(); | |
| 43 } | |
| 44 | |
| 45 void MediaController::SetClient(mojom::MediaClientAssociatedPtrInfo client) { | |
| 46 client_.Bind(std::move(client)); | |
| 47 } | |
| 48 | |
| 49 void MediaController::NotifyCaptureState( | |
| 50 const std::vector<mojom::MediaCaptureState>& capture_states) { | |
| 51 for (auto& observer : observers_) | |
| 52 observer.OnMediaCaptureChanged(capture_states); | |
| 53 } | |
| 54 | |
| 55 } // namespace ash | |
| OLD | NEW |