| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chromeos/dbus/fake_update_engine_client.h" | 5 #include "chromeos/dbus/fake_update_engine_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/threading/thread_task_runner_handle.h" | 8 #include "base/threading/thread_task_runner_handle.h" |
| 9 | 9 |
| 10 namespace chromeos { | 10 namespace chromeos { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 if (status_queue_.empty()) | 59 if (status_queue_.empty()) |
| 60 return default_status_; | 60 return default_status_; |
| 61 | 61 |
| 62 UpdateEngineClient::Status last_status = status_queue_.front(); | 62 UpdateEngineClient::Status last_status = status_queue_.front(); |
| 63 status_queue_.pop(); | 63 status_queue_.pop(); |
| 64 return last_status; | 64 return last_status; |
| 65 } | 65 } |
| 66 | 66 |
| 67 void FakeUpdateEngineClient::NotifyObserversThatStatusChanged( | 67 void FakeUpdateEngineClient::NotifyObserversThatStatusChanged( |
| 68 const UpdateEngineClient::Status& status) { | 68 const UpdateEngineClient::Status& status) { |
| 69 FOR_EACH_OBSERVER(Observer, observers_, UpdateStatusChanged(status)); | 69 for (auto& observer : observers_) |
| 70 observer.UpdateStatusChanged(status); |
| 70 } | 71 } |
| 71 | 72 |
| 72 void FakeUpdateEngineClient::SetChannel(const std::string& target_channel, | 73 void FakeUpdateEngineClient::SetChannel(const std::string& target_channel, |
| 73 bool is_powerwash_allowed) { | 74 bool is_powerwash_allowed) { |
| 74 } | 75 } |
| 75 | 76 |
| 76 void FakeUpdateEngineClient::GetChannel(bool get_current_channel, | 77 void FakeUpdateEngineClient::GetChannel(bool get_current_channel, |
| 77 const GetChannelCallback& callback) { | 78 const GetChannelCallback& callback) { |
| 78 base::ThreadTaskRunnerHandle::Get()->PostTask( | 79 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 79 FROM_HERE, base::Bind(callback, std::string())); | 80 FROM_HERE, base::Bind(callback, std::string())); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 90 const UpdateEngineClient::Status& status) { | 91 const UpdateEngineClient::Status& status) { |
| 91 default_status_ = status; | 92 default_status_ = status; |
| 92 } | 93 } |
| 93 | 94 |
| 94 void FakeUpdateEngineClient::set_update_check_result( | 95 void FakeUpdateEngineClient::set_update_check_result( |
| 95 const UpdateEngineClient::UpdateCheckResult& result) { | 96 const UpdateEngineClient::UpdateCheckResult& result) { |
| 96 update_check_result_ = result; | 97 update_check_result_ = result; |
| 97 } | 98 } |
| 98 | 99 |
| 99 } // namespace chromeos | 100 } // namespace chromeos |
| OLD | NEW |