| 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 @class PhysicalWebDevice; | 10 #include <memory> |
| 11 |
| 12 namespace base { |
| 13 class ListValue; |
| 14 } |
| 11 | 15 |
| 12 @protocol PhysicalWebScannerDelegate; | 16 @protocol PhysicalWebScannerDelegate; |
| 13 | 17 |
| 14 // This class will scan for physical web devices. | 18 // This class will scan for physical web devices. |
| 15 | 19 |
| 16 @interface PhysicalWebScanner : NSObject | 20 @interface PhysicalWebScanner : NSObject |
| 17 | 21 |
| 18 // When networkRequest is NO, no network request will be sent. | 22 // When networkRequest is NO, no network request will be sent. |
| 19 @property(nonatomic, assign) BOOL networkRequestEnabled; | 23 @property(nonatomic, assign) BOOL networkRequestEnabled; |
| 20 | 24 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 36 // It can happen when the bluetooth is turned off. In this case, scanning will | 40 // It can happen when the bluetooth is turned off. In this case, scanning will |
| 37 // start as soon as the bluetooth is turned on. | 41 // start as soon as the bluetooth is turned on. |
| 38 - (void)start; | 42 - (void)start; |
| 39 | 43 |
| 40 // Stop scanning. | 44 // Stop scanning. |
| 41 - (void)stop; | 45 - (void)stop; |
| 42 | 46 |
| 43 // Returns a list of physical web devices (PhysicalWebDevice). | 47 // Returns a list of physical web devices (PhysicalWebDevice). |
| 44 - (NSArray*)devices; | 48 - (NSArray*)devices; |
| 45 | 49 |
| 50 // Returns the metadata for all resolved physical web URLs. The returned value |
| 51 // will never be nil; if no metadata has been received then an empty list is |
| 52 // returned. |
| 53 - (std::unique_ptr<base::ListValue>)metadata; |
| 54 |
| 46 @end | 55 @end |
| 47 | 56 |
| 48 @protocol PhysicalWebScannerDelegate<NSObject> | 57 @protocol PhysicalWebScannerDelegate<NSObject> |
| 49 | 58 |
| 50 // This delegate method is called when the list of discovered devices is updated | 59 // This delegate method is called when the list of discovered devices is updated |
| 51 // by the scanner. | 60 // by the scanner. |
| 52 - (void)scannerUpdatedDevices:(PhysicalWebScanner*)scanner; | 61 - (void)scannerUpdatedDevices:(PhysicalWebScanner*)scanner; |
| 53 | 62 |
| 54 // This delegate method is called when the bluetooth status is updated. | 63 // This delegate method is called when the bluetooth status is updated. |
| 55 - (void)scannerBluetoothStatusUpdated:(PhysicalWebScanner*)scanner; | 64 - (void)scannerBluetoothStatusUpdated:(PhysicalWebScanner*)scanner; |
| 56 | 65 |
| 57 @end | 66 @end |
| 58 | 67 |
| 59 #endif // IOS_CHROME_COMMON_PHYSICAL_WEB_PHYSICAL_WEB_SCANNER_H_ | 68 #endif // IOS_CHROME_COMMON_PHYSICAL_WEB_PHYSICAL_WEB_SCANNER_H_ |
| OLD | NEW |