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