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

Side by Side Diff: ios/chrome/browser/web/mailto_handler_system_mail.mm

Issue 2852003002: Adds mailto: URL support to app launching. (Closed)
Patch Set: separate migration from auto-default even more 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #import "ios/chrome/browser/web/mailto_handler_system_mail.h"
6
7 #include "base/strings/sys_string_conversions.h"
8 #import "ios/chrome/browser/web/mailto_url_rewriter.h"
9 #include "ios/chrome/grit/ios_strings.h"
10 #include "ui/base/l10n/l10n_util.h"
11 #include "url/gurl.h"
12
13 #if !defined(__has_feature) || !__has_feature(objc_arc)
14 #error "This file requires ARC support."
15 #endif
16
17 @implementation MailtoHandlerSystemMail
18
19 - (instancetype)init {
20 NSString* name = l10n_util::GetNSString(IDS_IOS_SYSTEM_MAIL_APP);
21 self = [super initWithName:name appStoreID:[MailtoURLRewriter systemMailApp]];
22 return self;
23 }
24
25 - (BOOL)isAvailable {
26 // System Mail client app is always available.
27 return YES;
28 }
29
30 - (NSString*)rewriteMailtoURL:(const GURL&)gURL {
31 if (!gURL.SchemeIs(url::kMailToScheme))
32 return nil;
33 return base::SysUTF8ToNSString(gURL.spec());
34 }
35
36 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/web/mailto_handler_system_mail.h ('k') | ios/chrome/browser/web/mailto_handler_system_mail_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698