OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef IOS_CHROME_COMMON_PHYSICAL_WEB_PHYSICAL_WEB_SCANNER_H_ | 5 #ifndef IOS_CHROME_COMMON_PHYSICAL_WEB_PHYSICAL_WEB_SCANNER_H_ |
6 #define IOS_CHROME_COMMON_PHYSICAL_WEB_PHYSICAL_WEB_SCANNER_H_ | 6 #define IOS_CHROME_COMMON_PHYSICAL_WEB_PHYSICAL_WEB_SCANNER_H_ |
7 | 7 |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
| 11 #include <vector> |
11 | 12 |
12 namespace base { | 13 namespace base { |
13 class ListValue; | 14 class ListValue; |
14 } | 15 } |
15 | 16 |
| 17 namespace physical_web { |
| 18 struct Metadata; |
| 19 using MetadataList = std::vector<Metadata>; |
| 20 } |
| 21 |
16 @protocol PhysicalWebScannerDelegate; | 22 @protocol PhysicalWebScannerDelegate; |
17 | 23 |
18 // This class will scan for physical web devices. | 24 // This class will scan for physical web devices. |
19 | 25 |
20 @interface PhysicalWebScanner : NSObject | 26 @interface PhysicalWebScanner : NSObject |
21 | 27 |
22 // When onLostDetectionEnabled is YES, the delegate will be notified if a URL | 28 // When onLostDetectionEnabled is YES, the delegate will be notified if a URL |
23 // that was previously nearby is no longer detected. Changing this value while | 29 // that was previously nearby is no longer detected. Changing this value while |
24 // scanning is active will reset the list of nearby URLs. | 30 // scanning is active will reset the list of nearby URLs. |
25 @property(nonatomic, assign) BOOL onLostDetectionEnabled; | 31 @property(nonatomic, assign) BOOL onLostDetectionEnabled; |
(...skipping 24 matching lines...) Expand all Loading... |
50 - (void)stop; | 56 - (void)stop; |
51 | 57 |
52 // Returns a list of physical web devices (PhysicalWebDevice). | 58 // Returns a list of physical web devices (PhysicalWebDevice). |
53 - (NSArray*)devices; | 59 - (NSArray*)devices; |
54 | 60 |
55 // Returns the metadata for all resolved physical web URLs. The returned value | 61 // Returns the metadata for all resolved physical web URLs. The returned value |
56 // will never be nil; if no metadata has been received then an empty list is | 62 // will never be nil; if no metadata has been received then an empty list is |
57 // returned. | 63 // returned. |
58 - (std::unique_ptr<base::ListValue>)metadata; | 64 - (std::unique_ptr<base::ListValue>)metadata; |
59 | 65 |
| 66 // Returns the metadata for all resolved physical web URLs. The returned value |
| 67 // will never be nil; if no metadata has been received then an empty list is |
| 68 // returned. |
| 69 - (std::unique_ptr<physical_web::MetadataList>)metadataList; |
| 70 |
60 @end | 71 @end |
61 | 72 |
62 @protocol PhysicalWebScannerDelegate<NSObject> | 73 @protocol PhysicalWebScannerDelegate<NSObject> |
63 | 74 |
64 // This delegate method is called when the list of discovered devices is updated | 75 // This delegate method is called when the list of discovered devices is updated |
65 // by the scanner. | 76 // by the scanner. |
66 - (void)scannerUpdatedDevices:(PhysicalWebScanner*)scanner; | 77 - (void)scannerUpdatedDevices:(PhysicalWebScanner*)scanner; |
67 | 78 |
68 // This delegate method is called when the bluetooth status is updated. | 79 // This delegate method is called when the bluetooth status is updated. |
69 - (void)scannerBluetoothStatusUpdated:(PhysicalWebScanner*)scanner; | 80 - (void)scannerBluetoothStatusUpdated:(PhysicalWebScanner*)scanner; |
70 | 81 |
71 @end | 82 @end |
72 | 83 |
73 #endif // IOS_CHROME_COMMON_PHYSICAL_WEB_PHYSICAL_WEB_SCANNER_H_ | 84 #endif // IOS_CHROME_COMMON_PHYSICAL_WEB_PHYSICAL_WEB_SCANNER_H_ |
OLD | NEW |