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

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: Add required/optional comments Created 4 years 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 23 matching lines...) Expand all
34 34
35 class FakePhysicalWebDataSource : public PhysicalWebDataSource { 35 class FakePhysicalWebDataSource : public PhysicalWebDataSource {
36 public: 36 public:
37 FakePhysicalWebDataSource(); 37 FakePhysicalWebDataSource();
38 ~FakePhysicalWebDataSource() override; 38 ~FakePhysicalWebDataSource() override;
39 39
40 void StartDiscovery(bool network_request_enabled) override; 40 void StartDiscovery(bool network_request_enabled) override;
41 void StopDiscovery() override; 41 void StopDiscovery() override;
42 42
43 std::unique_ptr<base::ListValue> GetMetadata() override; 43 std::unique_ptr<base::ListValue> GetMetadata() override;
44 std::unique_ptr<MetadataList> GetMetadataList() 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);
53 void SetMetadataList(std::unique_ptr<MetadataList> metadata_list);
52 void NotifyOnFound(const std::string& url); 54 void NotifyOnFound(const std::string& url);
53 void NotifyOnLost(const std::string& url); 55 void NotifyOnLost(const std::string& url);
54 void NotifyOnDistanceChanged(const std::string& url, 56 void NotifyOnDistanceChanged(const std::string& url,
55 double distance_estimate); 57 double distance_estimate);
56 58
57 private: 59 private:
58 std::unique_ptr<base::ListValue> metadata_; 60 std::unique_ptr<base::ListValue> metadata_;
61 std::unique_ptr<MetadataList> metadata_list_;
59 base::ObserverList<PhysicalWebListener> observer_list_; 62 base::ObserverList<PhysicalWebListener> observer_list_;
60 63
61 DISALLOW_COPY_AND_ASSIGN(FakePhysicalWebDataSource); 64 DISALLOW_COPY_AND_ASSIGN(FakePhysicalWebDataSource);
62 }; 65 };
63 66
64 } // namespace physical_web 67 } // namespace physical_web
65 68
66 #endif // COMPONENTS_PHYSICAL_WEB_DATA_SOURCE_FAKE_PHYSICAL_WEB_DATA_SOURCE_H_ 69 #endif // COMPONENTS_PHYSICAL_WEB_DATA_SOURCE_FAKE_PHYSICAL_WEB_DATA_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698