Chromium Code Reviews| 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..05499c43f9258d85ff3e1881b68217cdd6bd6f54 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, assign) id<MailtoURLRewriterObserver> observer; |
|
jif
2017/05/10 09:32:07
use weak instead of assign to avoid the risk of ha
pkl (ping after 24h if needed)
2017/05/10 16:28:06
Done.
|
| + |
| // 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. |