Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Side by Side Diff: ios/public/provider/chrome/browser/native_app_launcher/native_app_metadata.h

Issue 2464963004: [ios] Adds protocols for native app launching (Closed)
Patch Set: CL Feedback and New protocol method Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
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_
7
8 #import <Foundation/Foundation.h>
9 // TODO(sczs) Import NativeAppInfoBarDelegate once it lands upstream.
10
11 @class ChromeIdentity;
12 class GURL;
13 @class UIImage;
14
15 namespace net {
16 class URLRequestContextGetter;
17 }
18
19 // Protocol todo describe
20 @protocol NativeAppMetadata<NSObject>
21
22 // Defines whether the app should be opened automatically upon Link Navigation.
23 // This is a tri-state value internally: Yes, No, not set. However, externally,
24 // only the Yes/No state is returned via the property getter. If the internal
25 // value is "not set", then it is up to the current implementation to decide
26 // whether it should be treated as a YES or a NO. The property setter can set
27 // the value to either YES or NO. To set the value to "not set", use
28 // -unsetShouldAutoOpenLinks.
29 @property(nonatomic, assign) BOOL shouldAutoOpenLinks;
30 - (void)unsetShouldAutoOpenLinks;
rohitrao (ping after 24h) 2016/11/09 02:19:21 Blank line above this and add a method comment. /
sczs1 2016/11/10 03:30:19 Done.
31
32 // Defines whether infobars for this app should be bypassed.
33 @property(nonatomic, assign) BOOL shouldBypassInfoBars;
34 // Stores the number of times a banner is dismissed or ignored.
rohitrao (ping after 24h) 2016/11/09 02:19:21 Blank line above this.
sczs1 2016/11/10 03:30:19 Done.
35 @property(nonatomic, assign) NSInteger numberOfDismissedInfoBars;
36
37 // Returns the application name for this native app. If there is a localized
38 // name for the current locale, return the localized name. Otherwise, return
39 // the default application name.
40 - (NSString*)appName;
41
42 // Returns the App Store application id for this native app or |nil| if
43 // app does not have an AppStore ID.
44 - (NSString*)appId;
45
46 // Returns whether this native app is a Google App.
47 - (BOOL)isGoogleOwnedApp;
48
49 // Returns whether this native app is installed.
50 - (BOOL)isInstalled;
51
52 // Returns the URL string that launches Apple AppStore for this app.
53 - (NSString*)appStoreURL;
54
55 // Returns the URL to test if the app is installed.
56 - (NSURL*)appURLforURL:(NSURL*)url;
57
58 // Calls |block| with the application icon. |contextGetter| must not be nil.
59 - (void)fetchSmallIconWithContext:(net::URLRequestContextGetter*)contextGetter
60 completionBlock:(void (^)(UIImage*))block;
61
62 // Returns whether this native application can open the |url|.
63 - (BOOL)canOpenURL:(const GURL&)url;
64
65 // Returns the launch URL with which the application can be opened. |gurl| is
66 // the URL of the content in the web app. If |identity| is not nil, the
67 // returned URL contains a hash associated with |identity|.
68 - (GURL)launchURLWithURL:(const GURL&)gurl identity:(ChromeIdentity*)identity;
69
70 // Resets values of shouldBypassInfobars and numberOfDismissedInfoBarsKey.
71 - (void)resetInfobarHistory;
72
73 // Enumerates the app's registered schemes. The block can be called multiple
74 // times for the same scheme.
75 - (void)enumerateSchemesWithBlock:(void (^)(NSString* scheme, BOOL* stop))block;
76
77 // Informs the metadata that user has requested the application to be installed
78 // from a user interface other than a Launcher infobar.
79 - (void)updateCounterWithAppInstallation;
80
81 // Returns any of the schemes that the app has registered.
82 - (NSString*)anyScheme;
83
84 // TODO(sczs) Remove comments once rest of NativeAppInfoBarDelegate lands
85 // upstream.
86 // This method needs to be called whenever the metadata info is displayed by an
87 // infobar.
88 //- (void)willBeShownInInfobarOfType:
89 // (NativeAppInfoBarDelegate::NativeAppControllerType)type;
rohitrao (ping after 24h) 2016/11/09 02:19:21 Per discussion, let's add these enums to a new fil
sczs1 2016/11/10 03:30:19 Acknowledged.
90 //
91 //// Informs the metadata on what user action on the infobar has been taken.
92 //// Requires to have previously send the message -[NativeAppMetadata
93 //// willBeShownInInfobarOfType:].
94 //- (void)updateWithUserAction:(NativeAppInfoBarDelegate::UserAction)userAction;
95
96 @end
97
98 #endif // IOS_PUBLIC_PROVIDER_CHROME_BROWSER_NATIVE_APP_LAUNCHER_NATIVE_APP_MET ADATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698