| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef IOS_CHROME_BROWSER_WEB_MAILTO_URL_REWRITER_H_ | 5 #ifndef IOS_CHROME_BROWSER_WEB_MAILTO_URL_REWRITER_H_ |
| 6 #define IOS_CHROME_BROWSER_WEB_MAILTO_URL_REWRITER_H_ | 6 #define IOS_CHROME_BROWSER_WEB_MAILTO_URL_REWRITER_H_ |
| 7 | 7 |
| 8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
| 9 | 9 |
| 10 @class MailtoHandler; | 10 @class MailtoHandler; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 @property(nonatomic, weak) id<MailtoURLRewriterObserver> observer; | 30 @property(nonatomic, weak) id<MailtoURLRewriterObserver> observer; |
| 31 | 31 |
| 32 // Returns the ID as a string for the system-provided Mail client app. | 32 // Returns the ID as a string for the system-provided Mail client app. |
| 33 + (NSString*)systemMailApp; | 33 + (NSString*)systemMailApp; |
| 34 | 34 |
| 35 // An initializer returning an instance that has the standard set of | 35 // An initializer returning an instance that has the standard set of |
| 36 // MailtoHandlers initialized. Unit tests can use -init and then set up the | 36 // MailtoHandlers initialized. Unit tests can use -init and then set up the |
| 37 // different handlers. | 37 // different handlers. |
| 38 - (instancetype)initWithStandardHandlers; | 38 - (instancetype)initWithStandardHandlers; |
| 39 | 39 |
| 40 // Returns an array of all the currently supported Mail client apps that claims | 40 // Returns a sorted array of all the currently supported Mail client apps that |
| 41 // to handle mailto: URL scheme through their own custom defined URL schemes. | 41 // claim to handle mailto: URL scheme through their own custom defined URL |
| 42 // schemes. |
| 42 - (NSArray<MailtoHandler*>*)defaultHandlers; | 43 - (NSArray<MailtoHandler*>*)defaultHandlers; |
| 43 | 44 |
| 44 // Returns the name of the application that handles mailto: URLs. | 45 // Returns the name of the application that handles mailto: URLs. |
| 45 - (NSString*)defaultHandlerName; | 46 - (NSString*)defaultHandlerName; |
| 46 | 47 |
| 47 // Rewrites |gURL| into a new URL that can be "opened" to launch the Mail | 48 // Rewrites |gURL| into a new URL that can be "opened" to launch the Mail |
| 48 // client app. May return nil if |gURL| is not a mailto: URL or there are no | 49 // client app. May return nil if |gURL| is not a mailto: URL or there are no |
| 49 // Mail client app available. | 50 // Mail client app available. |
| 50 - (NSString*)rewriteMailtoURL:(const GURL&)gURL; | 51 - (NSString*)rewriteMailtoURL:(const GURL&)gURL; |
| 51 | 52 |
| 52 @end | 53 @end |
| 53 | 54 |
| 54 #endif // IOS_CHROME_BROWSER_WEB_MAILTO_URL_REWRITER_H_ | 55 #endif // IOS_CHROME_BROWSER_WEB_MAILTO_URL_REWRITER_H_ |
| OLD | NEW |