OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_COMMON_PHYSICAL_WEB_PHYSICAL_WEB_DATA_SOURCE_IOS_H_ |
| 6 #define IOS_CHROME_COMMON_PHYSICAL_WEB_PHYSICAL_WEB_DATA_SOURCE_IOS_H_ |
| 7 |
| 8 #include "components/physical_web_data_source/physical_web_data_source.h" |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/values.h" |
| 12 #import "base/mac/scoped_nsobject.h" |
| 13 #import "ios/chrome/common/physical_web/physical_web_scanner.h" |
| 14 |
| 15 // IOS implementation of PhysicalWebDataSource |
| 16 class PhysicalWebDataSourceIOS : public PhysicalWebDataSource { |
| 17 public: |
| 18 PhysicalWebDataSourceIOS(); |
| 19 ~PhysicalWebDataSourceIOS() override; |
| 20 |
| 21 // Starts scanning for Physical Web URLs. If |network_request_enabled| is |
| 22 // true, discovered URLs will be sent to a resolution service. |
| 23 void StartDiscovery(bool network_request_enabled) override; |
| 24 |
| 25 // Stops scanning for Physical Web URLs and clears cached URL content. |
| 26 void StopDiscovery() override; |
| 27 |
| 28 // Returns a list of resolved URLs and associated page metadata. If network |
| 29 // requests are disabled, the list will be empty. |
| 30 std::unique_ptr<base::ListValue> GetMetadata() override; |
| 31 |
| 32 // Returns boolean |true| if network requests are disabled and there are one |
| 33 // or more discovered URLs that have not been sent to the resolution service. |
| 34 bool HasUnresolvedDiscoveries() override; |
| 35 |
| 36 private: |
| 37 // Scanner for nearby Physical Web URL devices. |
| 38 base::scoped_nsobject<PhysicalWebScanner> scanner_; |
| 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(PhysicalWebDataSourceIOS); |
| 41 }; |
| 42 |
| 43 #endif // IOS_CHROME_COMMON_PHYSICAL_WEB_PHYSICAL_WEB_DATA_SOURCE_IOS_H_ |
OLD | NEW |