| 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 #ifndef COMPONENTS_PHYSICAL_WEB_DATA_SOURCE_PHYSICAL_WEB_DATA_SOURCE_IMPL_H_ | 4 #ifndef COMPONENTS_PHYSICAL_WEB_DATA_SOURCE_PHYSICAL_WEB_DATA_SOURCE_IMPL_H_ |
| 5 #define COMPONENTS_PHYSICAL_WEB_DATA_SOURCE_PHYSICAL_WEB_DATA_SOURCE_IMPL_H_ | 5 #define COMPONENTS_PHYSICAL_WEB_DATA_SOURCE_PHYSICAL_WEB_DATA_SOURCE_IMPL_H_ |
| 6 | 6 |
| 7 #include "base/observer_list.h" | 7 #include "base/observer_list.h" |
| 8 #include "components/physical_web/data_source/physical_web_data_source.h" | 8 #include "components/physical_web/data_source/physical_web_data_source.h" |
| 9 | 9 |
| 10 class GURL; |
| 11 |
| 10 namespace physical_web { | 12 namespace physical_web { |
| 11 | 13 |
| 12 class PhysicalWebListener; | 14 class PhysicalWebListener; |
| 13 | 15 |
| 14 class PhysicalWebDataSourceImpl : public PhysicalWebDataSource { | 16 class PhysicalWebDataSourceImpl : public PhysicalWebDataSource { |
| 15 public: | 17 public: |
| 16 PhysicalWebDataSourceImpl(); | 18 PhysicalWebDataSourceImpl(); |
| 17 ~PhysicalWebDataSourceImpl() override; | 19 ~PhysicalWebDataSourceImpl() override; |
| 18 | 20 |
| 19 // Register for changes to Physical Web URLs and associated page metadata. | 21 // Register for changes to Physical Web URLs and associated page metadata. |
| 20 void RegisterListener(PhysicalWebListener* physical_web_listener) override; | 22 void RegisterListener(PhysicalWebListener* physical_web_listener) override; |
| 21 | 23 |
| 22 // Unregister for changes to Physical Web URLs and associated page metadata. | 24 // Unregister for changes to Physical Web URLs and associated page metadata. |
| 23 void UnregisterListener(PhysicalWebListener* physical_web_listener) override; | 25 void UnregisterListener(PhysicalWebListener* physical_web_listener) override; |
| 24 | 26 |
| 25 // Notify all registered listeners that a URL has been found. | 27 // Notify all registered listeners that a URL has been found. |
| 26 void NotifyOnFound(const std::string& url); | 28 void NotifyOnFound(const GURL& url); |
| 27 | 29 |
| 28 // Notify all registered listeners that a URL has been lost. | 30 // Notify all registered listeners that a URL has been lost. |
| 29 void NotifyOnLost(const std::string& url); | 31 void NotifyOnLost(const GURL& url); |
| 30 | 32 |
| 31 // Notify all registered listeners that a distance has changed for a URL. | 33 // Notify all registered listeners that a distance has changed for a URL. |
| 32 void NotifyOnDistanceChanged(const std::string& url, | 34 void NotifyOnDistanceChanged(const GURL& url, |
| 33 double distance_estimate); | 35 double distance_estimate); |
| 34 | 36 |
| 35 private: | 37 private: |
| 36 base::ObserverList<PhysicalWebListener> observer_list_; | 38 base::ObserverList<PhysicalWebListener> observer_list_; |
| 37 }; | 39 }; |
| 38 | 40 |
| 39 } // namespace physical_web | 41 } // namespace physical_web |
| 40 | 42 |
| 41 #endif // COMPONENTS_PHYSICAL_WEB_DATA_SOURCE_PHYSICAL_WEB_DATA_SOURCE_IMPL_H_ | 43 #endif // COMPONENTS_PHYSICAL_WEB_DATA_SOURCE_PHYSICAL_WEB_DATA_SOURCE_IMPL_H_ |
| OLD | NEW |