| 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 | 13 |
| 14 class GURL; | 14 class GURL; |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 class DictionaryValue; | |
| 18 class ListValue; | 17 class ListValue; |
| 19 } | 18 } |
| 20 | 19 |
| 21 namespace physical_web { | 20 namespace physical_web { |
| 22 | 21 |
| 23 std::unique_ptr<base::DictionaryValue> CreatePhysicalWebPage( | 22 std::unique_ptr<Metadata> CreatePhysicalWebPage( |
| 24 const std::string& resolved_url, | 23 const std::string& resolved_url, |
| 25 double distance_estimate, | 24 double distance_estimate, |
| 26 const std::string& group_id, | 25 const std::string& group_id, |
| 27 int scan_timestamp, | 26 int scan_timestamp, |
| 28 const std::string& title, | 27 const std::string& title, |
| 29 const std::string& description, | 28 const std::string& description, |
| 30 const std::string& scanned_url); | 29 const std::string& scanned_url); |
| 31 | 30 |
| 32 std::unique_ptr<base::DictionaryValue> | 31 std::unique_ptr<Metadata> |
| 33 CreateDummyPhysicalWebPage(int id, double distance, int timestamp); | 32 CreateDummyPhysicalWebPage(int id, double distance, int timestamp); |
| 34 | 33 |
| 35 std::unique_ptr<base::ListValue> CreateDummyPhysicalWebPages( | 34 std::unique_ptr<MetadataList> CreateDummyPhysicalWebPages( |
| 36 const std::vector<int>& ids); | 35 const std::vector<int>& ids); |
| 37 | 36 |
| 38 class FakePhysicalWebDataSource : public PhysicalWebDataSource { | 37 class FakePhysicalWebDataSource : public PhysicalWebDataSource { |
| 39 public: | 38 public: |
| 40 FakePhysicalWebDataSource(); | 39 FakePhysicalWebDataSource(); |
| 41 ~FakePhysicalWebDataSource() override; | 40 ~FakePhysicalWebDataSource() override; |
| 42 | 41 |
| 43 void StartDiscovery(bool network_request_enabled) override; | 42 void StartDiscovery(bool network_request_enabled) override; |
| 44 void StopDiscovery() override; | 43 void StopDiscovery() override; |
| 45 | 44 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 62 std::unique_ptr<base::ListValue> metadata_; | 61 std::unique_ptr<base::ListValue> metadata_; |
| 63 std::unique_ptr<MetadataList> metadata_list_; | 62 std::unique_ptr<MetadataList> metadata_list_; |
| 64 base::ObserverList<PhysicalWebListener> observer_list_; | 63 base::ObserverList<PhysicalWebListener> observer_list_; |
| 65 | 64 |
| 66 DISALLOW_COPY_AND_ASSIGN(FakePhysicalWebDataSource); | 65 DISALLOW_COPY_AND_ASSIGN(FakePhysicalWebDataSource); |
| 67 }; | 66 }; |
| 68 | 67 |
| 69 } // namespace physical_web | 68 } // namespace physical_web |
| 70 | 69 |
| 71 #endif // COMPONENTS_PHYSICAL_WEB_DATA_SOURCE_FAKE_PHYSICAL_WEB_DATA_SOURCE_H_ | 70 #endif // COMPONENTS_PHYSICAL_WEB_DATA_SOURCE_FAKE_PHYSICAL_WEB_DATA_SOURCE_H_ |
| OLD | NEW |