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

Unified Diff: components/ntp_snippets/physical_web_pages/fake_physical_web_data_source.h

Issue 2517113005: [NTP::PhysicalWeb] Wire Physical Web provider to the data source. (Closed)
Patch Set: treib@ comment. Created 4 years, 1 month 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/ntp_snippets/physical_web_pages/fake_physical_web_data_source.h
diff --git a/components/ntp_snippets/physical_web_pages/fake_physical_web_data_source.h b/components/ntp_snippets/physical_web_pages/fake_physical_web_data_source.h
new file mode 100644
index 0000000000000000000000000000000000000000..d9aed3ef37af80ffca308296c619e05d38b938a6
--- /dev/null
+++ b/components/ntp_snippets/physical_web_pages/fake_physical_web_data_source.h
@@ -0,0 +1,39 @@
+// 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_NTP_SNIPPETS_PHYSICAL_WEB_PAGES_FAKE_PHYSICAL_WEB_PAGE_DATA_SOURCE_H_
+#define COMPONENTS_NTP_SNIPPETS_PHYSICAL_WEB_PAGES_FAKE_PHYSICAL_WEB_PAGE_DATA_SOURCE_H_
+
+#include <memory>
+
+#include "base/values.h"
+#include "components/physical_web/data_source/physical_web_data_source.h"
+#include "components/physical_web/data_source/physical_web_listener.h"
+
+namespace ntp_snippets {
+
+class FakePhysicalWebDataSource : public PhysicalWebDataSource {
+ public:
+ FakePhysicalWebDataSource();
+ ~FakePhysicalWebDataSource() override;
+
+ // PhysicalWebDataSource implementation.
+ void StartDiscovery(bool network_request_enabled) override;
+ void StopDiscovery() override;
+ std::unique_ptr<base::ListValue> GetMetadata() override;
+ bool HasUnresolvedDiscoveries() override;
+ void RegisterListener(PhysicalWebListener* physical_web_listener) override;
+ void UnregisterListener(PhysicalWebListener* physical_web_listener) override;
+
+ void SetMetadata(std::unique_ptr<base::ListValue> metadata);
+
+ private:
+ std::unique_ptr<base::ListValue> metadata_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakePhysicalWebDataSource);
+};
+
+} // namespace ntp_snippets
+
+#endif // COMPONENTS_NTP_SNIPPETS_PHYSICAL_WEB_PAGES_FAKE_PHYSICAL_WEB_PAGE_DATA_SOURCE_H_

Powered by Google App Engine
This is Rietveld 408576698