Revert "Fix broken channel icon in chrome://help on CrOS" and try again
[chromium-blink-merge.git] / ios / chrome / browser / ui / commands / show_mail_composer_command.mm
blob6fbf4e6ebb1b09a5efaadaeb8f73c5d74512872b
1 // Copyright 2012 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.
5 #import "ios/chrome/browser/ui/commands/show_mail_composer_command.h"
7 #include "base/files/file_path.h"
8 #include "base/logging.h"
9 #include "base/mac/scoped_nsobject.h"
10 #include "ios/chrome/browser/ui/commands/ios_command_ids.h"
12 @implementation ShowMailComposerCommand {
13   base::scoped_nsobject<NSArray> _toRecipients;
14   base::scoped_nsobject<NSString> _subject;
15   base::scoped_nsobject<NSString> _body;
16   base::FilePath _textFileToAttach;
19 @synthesize emailNotConfiguredAlertTitleId = _emailNotConfiguredAlertTitleId;
20 @synthesize emailNotConfiguredAlertMessageId =
21     _emailNotConfiguredAlertMessageId;
23 - (instancetype)initWithTag:(NSInteger)tag {
24   NOTREACHED();
25   return nil;
28 - (instancetype)initWithToRecipient:(NSString*)toRecipient
29                              subject:(NSString*)subject
30                                 body:(NSString*)body
31       emailNotConfiguredAlertTitleId:(int)alertTitleId
32     emailNotConfiguredAlertMessageId:(int)alertMessageId {
33   DCHECK(alertTitleId);
34   DCHECK(alertMessageId);
35   self = [super initWithTag:IDC_SHOW_MAIL_COMPOSER];
36   if (self) {
37     _toRecipients.reset([@[ toRecipient ] retain]);
38     _subject.reset([subject copy]);
39     _body.reset([body copy]);
40     _emailNotConfiguredAlertTitleId = alertTitleId;
41     _emailNotConfiguredAlertMessageId = alertMessageId;
42   }
43   return self;
46 - (NSArray*)toRecipients {
47   return _toRecipients.get();
50 - (NSString*)subject {
51   return _subject.get();
54 - (NSString*)body {
55   return _body.get();
58 - (const base::FilePath&)textFileToAttach {
59   return _textFileToAttach;
62 - (void)setTextFileToAttach:(const base::FilePath&)textFileToAttach {
63   _textFileToAttach = textFileToAttach;
66 @end