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

Unified Diff: ios/chrome/browser/ui/show_mail_composer_util.mm

Issue 1058933002: [iOS] Upstream //ios/chrome/browser/ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@upstreamMemory
Patch Set: Review comments Created 5 years, 9 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 | « ios/chrome/browser/ui/show_mail_composer_util.h ('k') | ios/chrome/browser/ui/show_privacy_settings_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/show_mail_composer_util.mm
diff --git a/ios/chrome/browser/ui/show_mail_composer_util.mm b/ios/chrome/browser/ui/show_mail_composer_util.mm
new file mode 100644
index 0000000000000000000000000000000000000000..2d9624c56b1506cda08b68cc272a715c022e2aed
--- /dev/null
+++ b/ios/chrome/browser/ui/show_mail_composer_util.mm
@@ -0,0 +1,33 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ios/chrome/browser/ui/show_mail_composer_util.h"
+
+#include <UIKit/UIKit.h>
+
+#include "base/logging.h"
+#include "base/mac/scoped_nsobject.h"
+#include "base/strings/sys_string_conversions.h"
+#include "ios/chrome/browser/ui/commands/UIKit+ChromeExecuteCommand.h"
+#include "ios/chrome/browser/ui/commands/show_mail_composer_command.h"
+
+void ShowMailComposer(const base::string16& to_recipient,
+ const base::string16& subject,
+ const base::string16& body,
+ const base::string16& title,
+ const base::FilePath& text_file_to_attach,
+ int email_not_configured_alert_title_id,
+ int email_not_configured_alert_message_id) {
+ base::scoped_nsobject<ShowMailComposerCommand>
+ command([[ShowMailComposerCommand alloc]
+ initWithToRecipient:base::SysUTF16ToNSString(to_recipient)
+ subject:base::SysUTF16ToNSString(subject)
+ body:base::SysUTF16ToNSString(body)
+ emailNotConfiguredAlertTitleId:email_not_configured_alert_title_id
+ emailNotConfiguredAlertMessageId:email_not_configured_alert_message_id]);
+ [command setTextFileToAttach:text_file_to_attach];
+ UIWindow* main_window = [[UIApplication sharedApplication] keyWindow];
+ DCHECK(main_window);
+ [main_window.rootViewController chromeExecuteCommand:command];
+}
« no previous file with comments | « ios/chrome/browser/ui/show_mail_composer_util.h ('k') | ios/chrome/browser/ui/show_privacy_settings_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698