OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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_PUBLIC_PROVIDER_CHROME_BROWSER_NATIVE_APP_LAUNCHER_NATIVE_APP_METADA
TA_H_ | 5 #ifndef IOS_PUBLIC_PROVIDER_CHROME_BROWSER_NATIVE_APP_LAUNCHER_NATIVE_APP_METADA
TA_H_ |
6 #define IOS_PUBLIC_PROVIDER_CHROME_BROWSER_NATIVE_APP_LAUNCHER_NATIVE_APP_METADA
TA_H_ | 6 #define IOS_PUBLIC_PROVIDER_CHROME_BROWSER_NATIVE_APP_LAUNCHER_NATIVE_APP_METADA
TA_H_ |
7 | 7 |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 | 9 |
10 #import "ios/public/provider/chrome/browser/native_app_launcher/native_app_types
.h" | 10 #import "ios/public/provider/chrome/browser/native_app_launcher/native_app_types
.h" |
11 | 11 |
12 @class ChromeIdentity; | 12 @class ChromeIdentity; |
13 class GURL; | 13 class GURL; |
14 @class UIImage; | 14 @class UIImage; |
15 | 15 |
| 16 namespace image_fetcher { |
| 17 class IOSImageDataFetcherWrapper; |
| 18 } |
| 19 |
16 namespace net { | 20 namespace net { |
17 class URLRequestContextGetter; | 21 class URLRequestContextGetter; |
18 } | 22 } |
19 | 23 |
20 // Protocol todo describe | 24 // Protocol todo describe |
21 @protocol NativeAppMetadata<NSObject> | 25 @protocol NativeAppMetadata<NSObject> |
22 | 26 |
23 // Defines whether the app should be opened automatically upon Link Navigation. | 27 // Defines whether the app should be opened automatically upon Link Navigation. |
24 // This is a tri-state value internally: Yes, No, not set. However, externally, | 28 // This is a tri-state value internally: Yes, No, not set. However, externally, |
25 // only the Yes/No state is returned via the property getter. If the internal | 29 // only the Yes/No state is returned via the property getter. If the internal |
(...skipping 26 matching lines...) Expand all Loading... |
52 | 56 |
53 // Returns whether this native app is installed. | 57 // Returns whether this native app is installed. |
54 - (BOOL)isInstalled; | 58 - (BOOL)isInstalled; |
55 | 59 |
56 // Returns the URL string that launches Apple AppStore for this app. | 60 // Returns the URL string that launches Apple AppStore for this app. |
57 - (NSString*)appStoreURL; | 61 - (NSString*)appStoreURL; |
58 | 62 |
59 // Returns the URL to test if the app is installed. | 63 // Returns the URL to test if the app is installed. |
60 - (NSURL*)appURLforURL:(NSURL*)url; | 64 - (NSURL*)appURLforURL:(NSURL*)url; |
61 | 65 |
62 // Calls |block| with the application icon. |contextGetter| must not be nil. | 66 // Calls |block| with the application icon. |imageFetcher| must be kept alive |
63 - (void)fetchSmallIconWithContext:(net::URLRequestContextGetter*)contextGetter | 67 // during the fetch. |
64 completionBlock:(void (^)(UIImage*))block; | 68 - (void)fetchSmallIconWithImageFetcher: |
| 69 (image_fetcher::IOSImageDataFetcherWrapper*)imageFetcher |
| 70 completionBlock:(void (^)(UIImage*))block; |
65 | 71 |
66 // Returns whether this native application can open the |url|. | 72 // Returns whether this native application can open the |url|. |
67 - (BOOL)canOpenURL:(const GURL&)url; | 73 - (BOOL)canOpenURL:(const GURL&)url; |
68 | 74 |
69 // Returns the launch URL with which the application can be opened. |gurl| is | 75 // Returns the launch URL with which the application can be opened. |gurl| is |
70 // the URL of the content in the web app. If |identity| is not nil, the | 76 // the URL of the content in the web app. If |identity| is not nil, the |
71 // returned URL contains a hash associated with |identity|. | 77 // returned URL contains a hash associated with |identity|. |
72 - (GURL)launchURLWithURL:(const GURL&)gurl identity:(ChromeIdentity*)identity; | 78 - (GURL)launchURLWithURL:(const GURL&)gurl identity:(ChromeIdentity*)identity; |
73 | 79 |
74 // Resets values of shouldBypassInfobars and numberOfDismissedInfoBarsKey. | 80 // Resets values of shouldBypassInfobars and numberOfDismissedInfoBarsKey. |
(...skipping 15 matching lines...) Expand all Loading... |
90 - (void)willBeShownInInfobarOfType:(NativeAppControllerType)type; | 96 - (void)willBeShownInInfobarOfType:(NativeAppControllerType)type; |
91 | 97 |
92 // Informs the metadata on what user action on the infobar has been taken. | 98 // Informs the metadata on what user action on the infobar has been taken. |
93 // Requires to have previously send the message -[NativeAppMetadata | 99 // Requires to have previously send the message -[NativeAppMetadata |
94 // willBeShownInInfobarOfType:]. | 100 // willBeShownInInfobarOfType:]. |
95 - (void)updateWithUserAction:(NativeAppActionType)userAction; | 101 - (void)updateWithUserAction:(NativeAppActionType)userAction; |
96 | 102 |
97 @end | 103 @end |
98 | 104 |
99 #endif // IOS_PUBLIC_PROVIDER_CHROME_BROWSER_NATIVE_APP_LAUNCHER_NATIVE_APP_MET
ADATA_H_ | 105 #endif // IOS_PUBLIC_PROVIDER_CHROME_BROWSER_NATIVE_APP_LAUNCHER_NATIVE_APP_MET
ADATA_H_ |
OLD | NEW |