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

Side by Side Diff: ios/chrome/browser/web/mailto_url_rewriter.h

Issue 2852003002: Adds mailto: URL support to app launching. (Closed)
Patch Set: rebase Created 3 years, 7 months 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 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 // Class of a singleton object that manages the available Mail client apps
14 // and the selected Mail client app to handle mailto: URL scheme.
15 @interface MailtoURLRewriter : NSObject
16
17 // Returns the ID as a string for the system-provided Mail client app.
18 + (NSString*)systemMailApp;
19
20 // An initializer returning an instance that has the standard set of
21 // MailtoHandlers initialized. Unit tests can use -init and then set up the
22 // different handlers.
23 - (instancetype)initWithStandardHandlers;
24
25 // Returns an array of all the currently supported Mail client apps that claims
26 // to handle mailto: URL scheme through their own custom defined URL schemes.
27 - (NSArray<MailtoHandler*>*)defaultHandlers;
28
29 // Returns the ID as a string for the Mail client app was set to handle mailto:
30 // URL scheme.
31 - (NSString*)defaultHandlerID;
32
33 // Sets the ID as a string for the Mail client app that will handle mailto:
34 // URL scheme.
35 - (void)setDefaultHandlerID:(NSString*)appStoreID;
36
37 // Rewrites |gURL|, which must be a mailto: URL, into a new URL that can be
38 // "opened" to launch the Mail client app.
jif 2017/05/04 14:08:47 Can you mention that this can return nil? For exam
pkl (ping after 24h if needed) 2017/05/04 22:25:59 It's probably unnecessary to enumerate all the pos
39 - (NSString*)rewriteMailtoURL:(const GURL&)gURL;
40
41 @end
42
43 #endif // IOS_CHROME_BROWSER_WEB_MAILTO_URL_REWRITER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698