Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(396)

Side by Side Diff: components/physical_web/data_source/fake_physical_web_data_source.h

Issue 2561493002: Pass Physical Web metadata through a struct (Closed)
Patch Set: Forward declare MetadataList Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
(...skipping 25 matching lines...) Expand all
36 36
37 class FakePhysicalWebDataSource : public PhysicalWebDataSource { 37 class FakePhysicalWebDataSource : public PhysicalWebDataSource {
38 public: 38 public:
39 FakePhysicalWebDataSource(); 39 FakePhysicalWebDataSource();
40 ~FakePhysicalWebDataSource() override; 40 ~FakePhysicalWebDataSource() override;
41 41
42 void StartDiscovery(bool network_request_enabled) override; 42 void StartDiscovery(bool network_request_enabled) override;
43 void StopDiscovery() override; 43 void StopDiscovery() override;
44 44
45 std::unique_ptr<base::ListValue> GetMetadata() override; 45 std::unique_ptr<base::ListValue> GetMetadata() override;
46 std::unique_ptr<MetadataList> GetMetadataList() override;
46 47
47 bool HasUnresolvedDiscoveries() override; 48 bool HasUnresolvedDiscoveries() override;
48 49
49 void RegisterListener(PhysicalWebListener* physical_web_listener) override; 50 void RegisterListener(PhysicalWebListener* physical_web_listener) override;
50 void UnregisterListener(PhysicalWebListener* physical_web_listener) override; 51 void UnregisterListener(PhysicalWebListener* physical_web_listener) override;
51 52
52 // for testing 53 // for testing
53 void SetMetadata(std::unique_ptr<base::ListValue> metadata); 54 void SetMetadata(std::unique_ptr<base::ListValue> metadata);
55 void SetMetadataList(std::unique_ptr<MetadataList> metadata_list);
54 void NotifyOnFound(const GURL& url); 56 void NotifyOnFound(const GURL& url);
55 void NotifyOnLost(const GURL& url); 57 void NotifyOnLost(const GURL& url);
56 void NotifyOnDistanceChanged(const GURL& url, double distance_estimate); 58 void NotifyOnDistanceChanged(const GURL& url, double distance_estimate);
57 59
58 private: 60 private:
59 std::unique_ptr<base::ListValue> metadata_; 61 std::unique_ptr<base::ListValue> metadata_;
62 std::unique_ptr<MetadataList> metadata_list_;
60 base::ObserverList<PhysicalWebListener> observer_list_; 63 base::ObserverList<PhysicalWebListener> observer_list_;
61 64
62 DISALLOW_COPY_AND_ASSIGN(FakePhysicalWebDataSource); 65 DISALLOW_COPY_AND_ASSIGN(FakePhysicalWebDataSource);
63 }; 66 };
64 67
65 } // namespace physical_web 68 } // namespace physical_web
66 69
67 #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_
OLDNEW
« no previous file with comments | « components/physical_web/data_source/BUILD.gn ('k') | components/physical_web/data_source/fake_physical_web_data_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698