OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 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_BROWSER_WEB_MAILTO_HANDLER_H_ | |
6 #define _IOS_CHROME_BROWSER_WEB_MAILTO_HANDLER_H_ | |
7 | |
8 #import <Foundation/Foundation.h> | |
9 | |
10 class GURL; | |
11 | |
12 // MailtoHandler is the base class for Mail client apps that can handle | |
13 // mailto: URLs via custom URL schemes. To add support for Mail clients, | |
14 // subclass from this and add it to MailtoURLRewriter class. | |
15 @interface MailtoHandler : NSObject | |
16 | |
17 // Name of Mail client. This is a name that a user can recognize, e.g. @"Gmail". | |
18 @property(nonatomic, readonly) NSString* appName; | |
19 | |
20 // The iOS App Store ID for the Mail client. This is usually a string of digits. | |
21 @property(nonatomic, readonly) NSString* appStoreID; | |
22 | |
23 // Designated initializer that subclasses should call from -init. | |
24 - (instancetype)initWithName:(NSString*)appName | |
25 appStoreID:(NSString*)appStoreID; | |
26 | |
27 // Returns whether the Mail client app is installed. | |
28 - (BOOL)isAvailable; | |
jif
2017/05/03 13:01:35
I think the subclass should return the Mail client
pkl (ping after 24h if needed)
2017/05/03 22:17:18
May be I don't understand completely. Having this
jif
2017/05/04 14:08:47
Indeed it does not.
I'm suggesting factoring the c
jif
2017/05/05 09:49:39
Seems like you missed this reply (which is in the
| |
29 | |
30 // Rewrites |gURL| into a URL with a different URL scheme that will cause a | |
31 // native iOS app to be launched to handle the mailto: URL. Returns nil if | |
32 // |gURL| is not a mailto: URL. | |
33 // This method is intended to be an abstract interface for subclasses and is | |
34 // not implemented for this class. | |
35 - (NSString*)rewriteMailtoURL:(const GURL&)gURL; | |
36 | |
37 @end | |
38 | |
39 #endif // _IOS_CHROME_BROWSER_WEB_MAILTO_HANDLER_H_ | |
OLD | NEW |