OLD | NEW |
(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 |
OLD | NEW |