| 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 #ifndef COMPONENTS_PHYSICAL_WEB_DATA_SOURCE_FAKE_PHYSICAL_WEB_DATA_SOURCE_H_ | 5 #ifndef COMPONENTS_PHYSICAL_WEB_DATA_SOURCE_FAKE_PHYSICAL_WEB_DATA_SOURCE_H_ |
| 6 #define COMPONENTS_PHYSICAL_WEB_DATA_SOURCE_FAKE_PHYSICAL_WEB_DATA_SOURCE_H_ | 6 #define COMPONENTS_PHYSICAL_WEB_DATA_SOURCE_FAKE_PHYSICAL_WEB_DATA_SOURCE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| 11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
| 12 #include "components/physical_web/data_source/physical_web_data_source.h" | 12 #include "components/physical_web/data_source/physical_web_data_source.h" |
| 13 #include "url/gurl.h" |
| 13 | 14 |
| 14 namespace base { | 15 namespace base { |
| 15 class DictionaryValue; | 16 class DictionaryValue; |
| 16 class ListValue; | 17 class ListValue; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace physical_web { | 20 namespace physical_web { |
| 20 | 21 |
| 21 std::unique_ptr<base::DictionaryValue> CreatePhysicalWebPage( | 22 std::unique_ptr<base::DictionaryValue> CreatePhysicalWebPage( |
| 22 const std::string& resolved_url, | 23 const std::string& resolved_url, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 42 | 43 |
| 43 std::unique_ptr<base::ListValue> GetMetadata() override; | 44 std::unique_ptr<base::ListValue> GetMetadata() override; |
| 44 | 45 |
| 45 bool HasUnresolvedDiscoveries() override; | 46 bool HasUnresolvedDiscoveries() override; |
| 46 | 47 |
| 47 void RegisterListener(PhysicalWebListener* physical_web_listener) override; | 48 void RegisterListener(PhysicalWebListener* physical_web_listener) override; |
| 48 void UnregisterListener(PhysicalWebListener* physical_web_listener) override; | 49 void UnregisterListener(PhysicalWebListener* physical_web_listener) override; |
| 49 | 50 |
| 50 // for testing | 51 // for testing |
| 51 void SetMetadata(std::unique_ptr<base::ListValue> metadata); | 52 void SetMetadata(std::unique_ptr<base::ListValue> metadata); |
| 52 void NotifyOnFound(const std::string& url); | 53 void NotifyOnFound(const GURL& url); |
| 53 void NotifyOnLost(const std::string& url); | 54 void NotifyOnLost(const GURL& url); |
| 54 void NotifyOnDistanceChanged(const std::string& url, | 55 void NotifyOnDistanceChanged(const GURL& url, double distance_estimate); |
| 55 double distance_estimate); | |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 std::unique_ptr<base::ListValue> metadata_; | 58 std::unique_ptr<base::ListValue> metadata_; |
| 59 base::ObserverList<PhysicalWebListener> observer_list_; | 59 base::ObserverList<PhysicalWebListener> observer_list_; |
| 60 | 60 |
| 61 DISALLOW_COPY_AND_ASSIGN(FakePhysicalWebDataSource); | 61 DISALLOW_COPY_AND_ASSIGN(FakePhysicalWebDataSource); |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 } // namespace physical_web | 64 } // namespace physical_web |
| 65 | 65 |
| 66 #endif // COMPONENTS_PHYSICAL_WEB_DATA_SOURCE_FAKE_PHYSICAL_WEB_DATA_SOURCE_H_ | 66 #endif // COMPONENTS_PHYSICAL_WEB_DATA_SOURCE_FAKE_PHYSICAL_WEB_DATA_SOURCE_H_ |
| OLD | NEW |