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

Unified Diff: ios/chrome/common/physical_web/ios_chrome_physical_web_data_source.h

Issue 2113473002: Add a Physical Web data source (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo Created 4 years, 4 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: ios/chrome/common/physical_web/ios_chrome_physical_web_data_source.h
diff --git a/ios/chrome/common/physical_web/ios_chrome_physical_web_data_source.h b/ios/chrome/common/physical_web/ios_chrome_physical_web_data_source.h
new file mode 100644
index 0000000000000000000000000000000000000000..2960830ff4d23abdcab5d61f1480293c439271fb
--- /dev/null
+++ b/ios/chrome/common/physical_web/ios_chrome_physical_web_data_source.h
@@ -0,0 +1,46 @@
+// 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 IOS_CHROME_COMMON_PHYSICAL_WEB_IOS_CHROME_PHYSICAL_WEB_DATA_SOURCE_H_
+#define IOS_CHROME_COMMON_PHYSICAL_WEB_IOS_CHROME_PHYSICAL_WEB_DATA_SOURCE_H_
+
+#include "base/macros.h"
+#import "base/mac/scoped_nsobject.h"
+#include "components/physical_web/data_source/physical_web_data_source.h"
+
+namespace base {
+class ListValue;
+}
+
+@class PhysicalWebScanner;
+
+// iOS implementation of PhysicalWebDataSource
+class IOSChromePhysicalWebDataSource : public PhysicalWebDataSource {
+ public:
+ IOSChromePhysicalWebDataSource();
+ ~IOSChromePhysicalWebDataSource() override;
+
+ // Starts scanning for Physical Web URLs. If |network_request_enabled| is
+ // true, discovered URLs will be sent to a resolution service.
+ void StartDiscovery(bool network_request_enabled) override;
+
+ // Stops scanning for Physical Web URLs and clears cached URL content.
+ void StopDiscovery() override;
+
+ // Returns a list of resolved URLs and associated page metadata. If network
+ // requests are disabled, the list will be empty.
+ std::unique_ptr<base::ListValue> GetMetadata() override;
+
+ // Returns boolean |true| if network requests are disabled and there are one
+ // or more discovered URLs that have not been sent to the resolution service.
+ bool HasUnresolvedDiscoveries() override;
+
+ private:
+ // Scanner for nearby Physical Web URL devices.
+ base::scoped_nsobject<PhysicalWebScanner> scanner_;
+
+ DISALLOW_COPY_AND_ASSIGN(IOSChromePhysicalWebDataSource);
+};
+
+#endif // IOS_CHROME_COMMON_PHYSICAL_WEB_IOS_CHROME_PHYSICAL_WEB_DATA_SOURCE_H_
« no previous file with comments | « ios/chrome/common/physical_web/BUILD.gn ('k') | ios/chrome/common/physical_web/ios_chrome_physical_web_data_source.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698