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

Unified Diff: components/physical_web/data_source/physical_web_data_source_impl.h

Issue 2349483002: Implement Physical Web listener registration (Closed)
Patch Set: Fix build error Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: components/physical_web/data_source/physical_web_data_source_impl.h
diff --git a/components/physical_web/data_source/physical_web_data_source_impl.h b/components/physical_web/data_source/physical_web_data_source_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..df23be3c7ecdeab7d1e9447464ef18512faa3f5e
--- /dev/null
+++ b/components/physical_web/data_source/physical_web_data_source_impl.h
@@ -0,0 +1,37 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+#ifndef COMPONENTS_PHYSICAL_WEB_DATA_SOURCE_PHYSICAL_WEB_DATA_SOURCE_IMPL_H_
+#define COMPONENTS_PHYSICAL_WEB_DATA_SOURCE_PHYSICAL_WEB_DATA_SOURCE_IMPL_H_
+
+#include "base/observer_list.h"
+#include "components/physical_web/data_source/physical_web_data_source.h"
+
+class PhysicalWebListener;
+
+class PhysicalWebDataSourceImpl : public PhysicalWebDataSource {
+ public:
+ PhysicalWebDataSourceImpl();
+ ~PhysicalWebDataSourceImpl() override;
+
+ // Register for changes to Physical Web URLs and associated page metadata.
+ void RegisterListener(PhysicalWebListener* physical_web_listener) override;
+
+ // Unregister for changes to Physical Web URLs and associated page metadata.
+ void UnregisterListener(PhysicalWebListener* physical_web_listener) override;
+
+ // Notify all registered listeners that a URL has been found.
+ void NotifyOnFound(const std::string& url);
+
+ // Notify all registered listeners that a URL has been lost.
+ void NotifyOnLost(const std::string& url);
+
+ // Notify all registered listeners that a distance has changed for a URL.
+ void NotifyOnDistanceChanged(const std::string& url,
+ double distance_estimate);
+
+ private:
+ base::ObserverList<PhysicalWebListener> observer_list_;
+};
+
+#endif // COMPONENTS_PHYSICAL_WEB_DATA_SOURCE_PHYSICAL_WEB_DATA_SOURCE_IMPL_H_
« no previous file with comments | « components/physical_web/data_source/BUILD.gn ('k') | components/physical_web/data_source/physical_web_data_source_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698