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

Unified Diff: ios/chrome/browser/web/mailto_url_rewriter.h

Issue 2859743002: Adds MailtoURLRewriterObserver to MailtoURLRewriter (Closed)
Patch Set: make observer weak, and test it. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ios/chrome/browser/web/mailto_url_rewriter.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | ios/chrome/browser/web/mailto_url_rewriter.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698