| 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 "components/arc/arc_bridge_service.h" | 5 #include "components/arc/arc_bridge_service.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 DCHECK(CalledOnValidThread()); | 55 DCHECK(CalledOnValidThread()); |
| 56 observer_list_.RemoveObserver(observer); | 56 observer_list_.RemoveObserver(observer); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void ArcBridgeService::OnAppInstanceReady(AppInstancePtr app_ptr) { | 59 void ArcBridgeService::OnAppInstanceReady(AppInstancePtr app_ptr) { |
| 60 DCHECK(CalledOnValidThread()); | 60 DCHECK(CalledOnValidThread()); |
| 61 app_ptr_ = std::move(app_ptr); | 61 app_ptr_ = std::move(app_ptr); |
| 62 FOR_EACH_OBSERVER(Observer, observer_list(), OnAppInstanceReady()); | 62 FOR_EACH_OBSERVER(Observer, observer_list(), OnAppInstanceReady()); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void ArcBridgeService::OnAuthInstanceReady(AuthInstancePtr auth_ptr) { |
| 66 DCHECK(CalledOnValidThread()); |
| 67 auth_ptr_ = std::move(auth_ptr); |
| 68 FOR_EACH_OBSERVER(Observer, observer_list(), OnAuthInstanceReady()); |
| 69 } |
| 70 |
| 65 void ArcBridgeService::OnInputInstanceReady(InputInstancePtr input_ptr) { | 71 void ArcBridgeService::OnInputInstanceReady(InputInstancePtr input_ptr) { |
| 66 DCHECK(CalledOnValidThread()); | 72 DCHECK(CalledOnValidThread()); |
| 67 input_ptr_ = std::move(input_ptr); | 73 input_ptr_ = std::move(input_ptr); |
| 68 FOR_EACH_OBSERVER(Observer, observer_list(), OnInputInstanceReady()); | 74 FOR_EACH_OBSERVER(Observer, observer_list(), OnInputInstanceReady()); |
| 69 } | 75 } |
| 70 | 76 |
| 71 void ArcBridgeService::OnNotificationsInstanceReady( | 77 void ArcBridgeService::OnNotificationsInstanceReady( |
| 72 NotificationsInstancePtr notifications_ptr) { | 78 NotificationsInstancePtr notifications_ptr) { |
| 73 DCHECK(CalledOnValidThread()); | 79 DCHECK(CalledOnValidThread()); |
| 74 notifications_ptr_ = std::move(notifications_ptr); | 80 notifications_ptr_ = std::move(notifications_ptr); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 DCHECK(available_ != available); | 113 DCHECK(available_ != available); |
| 108 available_ = available; | 114 available_ = available; |
| 109 FOR_EACH_OBSERVER(Observer, observer_list(), OnAvailableChanged(available_)); | 115 FOR_EACH_OBSERVER(Observer, observer_list(), OnAvailableChanged(available_)); |
| 110 } | 116 } |
| 111 | 117 |
| 112 bool ArcBridgeService::CalledOnValidThread() { | 118 bool ArcBridgeService::CalledOnValidThread() { |
| 113 return thread_checker_.CalledOnValidThread(); | 119 return thread_checker_.CalledOnValidThread(); |
| 114 } | 120 } |
| 115 | 121 |
| 116 } // namespace arc | 122 } // namespace arc |
| OLD | NEW |