OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_COMMON_PHYSICAL_WEB_PHYSICAL_WEB_REQUEST_H_ |
| 6 #define IOS_CHROME_COMMON_PHYSICAL_WEB_PHYSICAL_WEB_REQUEST_H_ |
| 7 |
| 8 #import <Foundation/Foundation.h> |
| 9 |
| 10 #import "ios/chrome/common/physical_web/physical_web_types.h" |
| 11 |
| 12 // This class will perform a metadata service web request to expand the given |
| 13 // URL and return the metadata of the web page such as the title. |
| 14 |
| 15 @interface PhysicalWebRequest : NSObject |
| 16 |
| 17 // Initializes a metadata service web request with information about the |
| 18 // physical web device. |
| 19 - (instancetype)initWithDevice:(PhysicalWebDevice*)device |
| 20 NS_DESIGNATED_INITIALIZER; |
| 21 |
| 22 - (instancetype)init NS_UNAVAILABLE; |
| 23 |
| 24 // Starts the request and call the given |block| when finished. |
| 25 // |block| should not be nil. |
| 26 // If an error occurred, the block will be called with a non-nil error. |
| 27 // When no error occurred, the result will be available in a PhysicalWebDevice |
| 28 // data structure. |
| 29 - (void)start:(physical_web::RequestFinishedBlock)block; |
| 30 |
| 31 // Cancels the request. |
| 32 - (void)cancel; |
| 33 |
| 34 @end |
| 35 |
| 36 #endif // IOS_CHROME_COMMON_PHYSICAL_WEB_PHYSICAL_WEB_REQUEST_H_ |
OLD | NEW |