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

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

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 #include "components/physical_web/data_source/fake_physical_web_data_source.h" 5 #include "components/physical_web/data_source/fake_physical_web_data_source.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "components/physical_web/data_source/physical_web_listener.h" 8 #include "components/physical_web/data_source/physical_web_listener.h"
9 #include "url/gurl.h" 9 #include "url/gurl.h"
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 std::unique_ptr<MetadataList> FakePhysicalWebDataSource::GetMetadataList() { 69 std::unique_ptr<MetadataList> FakePhysicalWebDataSource::GetMetadataList() {
70 return base::MakeUnique<MetadataList>(*metadata_list_.get()); 70 return base::MakeUnique<MetadataList>(*metadata_list_.get());
71 } 71 }
72 72
73 bool FakePhysicalWebDataSource::HasUnresolvedDiscoveries() { 73 bool FakePhysicalWebDataSource::HasUnresolvedDiscoveries() {
74 return false; 74 return false;
75 } 75 }
76 76
77 void FakePhysicalWebDataSource::RegisterListener( 77 void FakePhysicalWebDataSource::RegisterListener(
78 PhysicalWebListener* physical_web_listener) { 78 PhysicalWebListener* physical_web_listener, ScanMode scan_mode) {
79 observer_list_.AddObserver(physical_web_listener); 79 observer_list_.AddObserver(physical_web_listener);
80 } 80 }
81 81
82 void FakePhysicalWebDataSource::UnregisterListener( 82 void FakePhysicalWebDataSource::UnregisterListener(
83 PhysicalWebListener* physical_web_listener) { 83 PhysicalWebListener* physical_web_listener) {
84 observer_list_.RemoveObserver(physical_web_listener); 84 observer_list_.RemoveObserver(physical_web_listener);
85 } 85 }
86 86
87 void FakePhysicalWebDataSource::SetMetadataList( 87 void FakePhysicalWebDataSource::SetMetadataList(
88 std::unique_ptr<MetadataList> metadata_list) { 88 std::unique_ptr<MetadataList> metadata_list) {
(...skipping 11 matching lines...) Expand all
100 } 100 }
101 101
102 void FakePhysicalWebDataSource::NotifyOnDistanceChanged( 102 void FakePhysicalWebDataSource::NotifyOnDistanceChanged(
103 const GURL& url, 103 const GURL& url,
104 double distance_estimate) { 104 double distance_estimate) {
105 for (PhysicalWebListener& observer : observer_list_) 105 for (PhysicalWebListener& observer : observer_list_)
106 observer.OnDistanceChanged(url, distance_estimate); 106 observer.OnDistanceChanged(url, distance_estimate);
107 } 107 }
108 108
109 } // namespace physical_web 109 } // namespace physical_web
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698