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_URL_REWRITER_H_ | |
6 #define IOS_CHROME_BROWSER_WEB_MAILTO_URL_REWRITER_H_ | |
7 | |
8 #import <Foundation/Foundation.h> | |
9 | |
10 @class MailtoHandler; | |
11 class GURL; | |
12 | |
13 // An object that manages the available Mail client apps. The currently selected | |
14 // Mail client to handle mailto: URL is stored in a key in NSUserDefaults. | |
15 // If the key in NSUserDefaults is not set, the system-provided Mail client app | |
16 // will be used. | |
17 @interface MailtoURLRewriter : NSObject | |
18 | |
19 // Returns the ID as a string for the system-provided Mail client app. | |
20 + (NSString*)systemMailApp; | |
21 | |
22 // An initializer returning an instance that has the standard set of | |
23 // MailtoHandlers initialized. Unit tests can use -init and then set up the | |
24 // different handlers. | |
25 - (instancetype)initWithStandardHandlers; | |
26 | |
27 // Returns an array of all the currently supported Mail client apps that claims | |
28 // to handle mailto: URL scheme through their own custom defined URL schemes. | |
29 - (NSArray<MailtoHandler*>*)defaultHandlers; | |
30 | |
31 // Returns the ID as a string for the Mail client app was set to handle mailto: | |
32 // URL scheme. | |
33 - (NSString*)defaultHandlerID; | |
rohitrao (ping after 24h)
2017/05/06 00:09:41
Could this/should this be a property?
pkl (ping after 24h if needed)
2017/05/08 17:07:56
Indeed it can be declared as a property in the API
| |
34 | |
35 // Sets the ID as a string for the Mail client app that will handle mailto: | |
36 // URL scheme. | |
37 - (void)setDefaultHandlerID:(NSString*)appStoreID; | |
38 | |
39 // Rewrites |gURL| into a new URL that can be "opened" to launch the Mail | |
40 // client app. May return nil if |gURL| is not a mailto: URL or there are no | |
41 // Mail client app available. | |
42 - (NSString*)rewriteMailtoURL:(const GURL&)gURL; | |
43 | |
44 @end | |
45 | |
46 #endif // IOS_CHROME_BROWSER_WEB_MAILTO_URL_REWRITER_H_ | |
OLD | NEW |