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

Unified Diff: chrome/browser/android/intent_helper.cc

Issue 10809061: Remove promo send email from tab android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resolve review comments. Created 8 years, 5 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 | « chrome/browser/android/intent_helper.h ('k') | chrome/browser/android/tab_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/intent_helper.cc
diff --git a/chrome/browser/android/intent_helper.cc b/chrome/browser/android/intent_helper.cc
new file mode 100644
index 0000000000000000000000000000000000000000..20beab02b8b6f72896d5f44198a572b76a1dbbf5
--- /dev/null
+++ b/chrome/browser/android/intent_helper.cc
@@ -0,0 +1,44 @@
+// Copyright (c) 2012 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 "chrome/browser/android/intent_helper.h"
+
+#include <jni.h>
+
+#include "base/android/jni_android.h"
+#include "base/android/jni_string.h"
+#include "base/android/scoped_java_ref.h"
+#include "jni/IntentHelper_jni.h"
+
+using base::android::AttachCurrentThread;
+using base::android::ConvertUTF16ToJavaString;
+
+namespace chrome {
+namespace android {
+
+void SendEmail(const string16& d_email,
+ const string16& d_subject,
+ const string16& d_body,
+ const string16& d_chooser_title) {
+ JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jstring> j_email = ConvertUTF16ToJavaString(env, d_email);
+ ScopedJavaLocalRef<jstring> j_subject =
+ ConvertUTF16ToJavaString(env, d_subject);
+ ScopedJavaLocalRef<jstring> j_body = ConvertUTF16ToJavaString(env, d_body);
+ ScopedJavaLocalRef<jstring> j_chooser_title =
+ ConvertUTF16ToJavaString(env, d_chooser_title);
+ Java_IntentHelper_sendEmail(env,
+ base::android::GetApplicationContext(),
+ j_email.obj(),
+ j_subject.obj(),
+ j_body.obj(),
+ j_chooser_title.obj());
+}
+
+bool RegisterIntentHelper(JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}
+
+} // namespace android
+} // namespace chrome
« no previous file with comments | « chrome/browser/android/intent_helper.h ('k') | chrome/browser/android/tab_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698