Index: ios/chrome/browser/web/mailto_handler.h |
diff --git a/ios/chrome/browser/web/mailto_handler.h b/ios/chrome/browser/web/mailto_handler.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d2746a80fb4d51eaa504533a7bcd69b7ba7e4921 |
--- /dev/null |
+++ b/ios/chrome/browser/web/mailto_handler.h |
@@ -0,0 +1,39 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef _IOS_CHROME_BROWSER_WEB_MAILTO_HANDLER_H_ |
+#define _IOS_CHROME_BROWSER_WEB_MAILTO_HANDLER_H_ |
+ |
+#import <Foundation/Foundation.h> |
+ |
+class GURL; |
+ |
+// MailtoHandler is the base class for Mail client apps that can handle |
+// mailto: URLs via custom URL schemes. To add support for Mail clients, |
+// subclass from this and add it to MailtoURLRewriter class. |
+@interface MailtoHandler : NSObject |
+ |
+// Name of Mail client. This is a name that a user can recognize, e.g. @"Gmail". |
+@property(nonatomic, readonly) NSString* appName; |
+ |
+// The iOS App Store ID for the Mail client. This is usually a string of digits. |
+@property(nonatomic, readonly) NSString* appStoreID; |
+ |
+// Designated initializer that subclasses should call from -init. |
+- (instancetype)initWithName:(NSString*)appName |
+ appStoreID:(NSString*)appStoreID; |
+ |
+// Returns whether the Mail client app is installed. |
+- (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
|
+ |
+// Rewrites |gURL| into a URL with a different URL scheme that will cause a |
+// native iOS app to be launched to handle the mailto: URL. Returns nil if |
+// |gURL| is not a mailto: URL. |
+// This method is intended to be an abstract interface for subclasses and is |
+// not implemented for this class. |
+- (NSString*)rewriteMailtoURL:(const GURL&)gURL; |
+ |
+@end |
+ |
+#endif // _IOS_CHROME_BROWSER_WEB_MAILTO_HANDLER_H_ |