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

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

Issue 2765713002: Associate a scan mode with Physical Web listeners (Closed)
Patch Set: Use key as parame to erase() Created 3 years, 9 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 24 matching lines...) Expand all
35 FakePhysicalWebDataSource(); 35 FakePhysicalWebDataSource();
36 ~FakePhysicalWebDataSource() override; 36 ~FakePhysicalWebDataSource() override;
37 37
38 void StartDiscovery(bool network_request_enabled) override; 38 void StartDiscovery(bool network_request_enabled) override;
39 void StopDiscovery() override; 39 void StopDiscovery() override;
40 40
41 std::unique_ptr<MetadataList> GetMetadataList() override; 41 std::unique_ptr<MetadataList> GetMetadataList() override;
42 42
43 bool HasUnresolvedDiscoveries() override; 43 bool HasUnresolvedDiscoveries() override;
44 44
45 void RegisterListener(PhysicalWebListener* physical_web_listener) override; 45 void RegisterListener(PhysicalWebListener* physical_web_listener,
46 ScanMode scan_mode) override;
46 void UnregisterListener(PhysicalWebListener* physical_web_listener) override; 47 void UnregisterListener(PhysicalWebListener* physical_web_listener) override;
47 48
48 // for testing 49 // for testing
49 void SetMetadataList(std::unique_ptr<MetadataList> metadata_list); 50 void SetMetadataList(std::unique_ptr<MetadataList> metadata_list);
50 void NotifyOnFound(const GURL& url); 51 void NotifyOnFound(const GURL& url);
51 void NotifyOnLost(const GURL& url); 52 void NotifyOnLost(const GURL& url);
52 void NotifyOnDistanceChanged(const GURL& url, double distance_estimate); 53 void NotifyOnDistanceChanged(const GURL& url, double distance_estimate);
53 54
54 private: 55 private:
55 std::unique_ptr<MetadataList> metadata_list_; 56 std::unique_ptr<MetadataList> metadata_list_;
56 base::ObserverList<PhysicalWebListener> observer_list_; 57 base::ObserverList<PhysicalWebListener> observer_list_;
57 58
58 DISALLOW_COPY_AND_ASSIGN(FakePhysicalWebDataSource); 59 DISALLOW_COPY_AND_ASSIGN(FakePhysicalWebDataSource);
59 }; 60 };
60 61
61 } // namespace physical_web 62 } // namespace physical_web
62 63
63 #endif // COMPONENTS_PHYSICAL_WEB_DATA_SOURCE_FAKE_PHYSICAL_WEB_DATA_SOURCE_H_ 64 #endif // COMPONENTS_PHYSICAL_WEB_DATA_SOURCE_FAKE_PHYSICAL_WEB_DATA_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698