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

Unified Diff: chrome/browser/platform_util_android.cc

Issue 1310873003: Implement PlatformUtil::OpenExternal() so that mailto: can work (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 5 years, 3 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/platform_util.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/platform_util_android.cc
diff --git a/chrome/browser/platform_util_android.cc b/chrome/browser/platform_util_android.cc
index 8a14b58f0f518dd5695b8d14db05266275e635cb..04a0f0d7b6bbced1092aba9db107d42baa0b12b1 100644
--- a/chrome/browser/platform_util_android.cc
+++ b/chrome/browser/platform_util_android.cc
@@ -2,9 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <jni.h>
+
+#include "base/android/jni_android.h"
+#include "base/android/jni_string.h"
#include "base/logging.h"
#include "chrome/browser/platform_util.h"
+#include "jni/PlatformUtil_jni.h"
#include "ui/android/view_android.h"
+#include "url/gurl.h"
namespace platform_util {
@@ -22,7 +28,10 @@ void OpenItem(Profile* profile,
}
void OpenExternal(Profile* profile, const GURL& url) {
- NOTIMPLEMENTED();
+ JNIEnv* env = base::android::AttachCurrentThread();
+ ScopedJavaLocalRef<jstring> j_url =
+ base::android::ConvertUTF8ToJavaString(env, url.spec());
+ Java_PlatformUtil_launchExternalProtocol(env, j_url.obj());
}
gfx::NativeWindow GetTopLevel(gfx::NativeView view) {
@@ -49,4 +58,8 @@ bool IsVisible(gfx::NativeView view) {
return true;
}
+bool RegisterPlatformUtil(JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}
+
} // namespace platform_util
« no previous file with comments | « chrome/browser/platform_util.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698