Index: ios/chrome/browser/web/mailto_url_rewriter.h |
diff --git a/ios/chrome/browser/web/mailto_url_rewriter.h b/ios/chrome/browser/web/mailto_url_rewriter.h |
index d5deb1cdc206713e8a5c0000b199162f8dbf1732..6eb0d865128d282375778c6f80cefa9d867189b9 100644 |
--- a/ios/chrome/browser/web/mailto_url_rewriter.h |
+++ b/ios/chrome/browser/web/mailto_url_rewriter.h |
@@ -8,8 +8,15 @@ |
#import <Foundation/Foundation.h> |
@class MailtoHandler; |
+@class MailtoURLRewriter; |
class GURL; |
+// Protocol that must be implemented by observers of MailtoURLRewriter object. |
+@protocol MailtoURLRewriterObserver<NSObject> |
+// The default mailto: handler has been changed. |
+- (void)rewriterDidChange:(MailtoURLRewriter*)rewriter; |
+@end |
+ |
// An object that manages the available Mail client apps. The currently selected |
// Mail client to handle mailto: URL is stored in a key in NSUserDefaults. |
// If the key in NSUserDefaults is not set, the system-provided Mail client app |
@@ -19,6 +26,9 @@ class GURL; |
// The unique ID of the Mail client app was set to handle mailto: URL scheme. |
@property(nonatomic, copy) NSString* defaultHandlerID; |
+// Observer object that will be called when |defaultHandlerID| is changed. |
+@property(nonatomic, weak) id<MailtoURLRewriterObserver> observer; |
+ |
// Returns the ID as a string for the system-provided Mail client app. |
+ (NSString*)systemMailApp; |
@@ -31,6 +41,9 @@ class GURL; |
// to handle mailto: URL scheme through their own custom defined URL schemes. |
- (NSArray<MailtoHandler*>*)defaultHandlers; |
+// Returns the name of the application that handles mailto: URLs. |
+- (NSString*)defaultHandlerName; |
+ |
// Rewrites |gURL| into a new URL that can be "opened" to launch the Mail |
// client app. May return nil if |gURL| is not a mailto: URL or there are no |
// Mail client app available. |