| 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 "base/observer_list.h" | 5 #include "base/observer_list.h" |
| 6 #include "components/physical_web/data_source/physical_web_data_source.h" | 6 #include "components/physical_web/data_source/physical_web_data_source.h" |
| 7 #include "components/physical_web/data_source/physical_web_data_source_impl.h" | 7 #include "components/physical_web/data_source/physical_web_data_source_impl.h" |
| 8 #include "components/physical_web/data_source/physical_web_listener.h" | 8 #include "components/physical_web/data_source/physical_web_listener.h" |
| 9 | 9 |
| 10 namespace physical_web { |
| 11 |
| 10 PhysicalWebDataSourceImpl::PhysicalWebDataSourceImpl() {} | 12 PhysicalWebDataSourceImpl::PhysicalWebDataSourceImpl() {} |
| 11 | 13 |
| 12 PhysicalWebDataSourceImpl::~PhysicalWebDataSourceImpl() {} | 14 PhysicalWebDataSourceImpl::~PhysicalWebDataSourceImpl() {} |
| 13 | 15 |
| 14 void PhysicalWebDataSourceImpl::RegisterListener( | 16 void PhysicalWebDataSourceImpl::RegisterListener( |
| 15 PhysicalWebListener* physical_web_listener) { | 17 PhysicalWebListener* physical_web_listener) { |
| 16 observer_list_.AddObserver(physical_web_listener); | 18 observer_list_.AddObserver(physical_web_listener); |
| 17 } | 19 } |
| 18 | 20 |
| 19 void PhysicalWebDataSourceImpl::UnregisterListener( | 21 void PhysicalWebDataSourceImpl::UnregisterListener( |
| (...skipping 10 matching lines...) Expand all Loading... |
| 30 for (PhysicalWebListener& observer : observer_list_) | 32 for (PhysicalWebListener& observer : observer_list_) |
| 31 observer.OnLost(url); | 33 observer.OnLost(url); |
| 32 } | 34 } |
| 33 | 35 |
| 34 void PhysicalWebDataSourceImpl::NotifyOnDistanceChanged( | 36 void PhysicalWebDataSourceImpl::NotifyOnDistanceChanged( |
| 35 const std::string& url, | 37 const std::string& url, |
| 36 double distance_estimate) { | 38 double distance_estimate) { |
| 37 for (PhysicalWebListener& observer : observer_list_) | 39 for (PhysicalWebListener& observer : observer_list_) |
| 38 observer.OnDistanceChanged(url, distance_estimate); | 40 observer.OnDistanceChanged(url, distance_estimate); |
| 39 } | 41 } |
| 42 |
| 43 } // namespace physical_web |
| OLD | NEW |