Chromium Code Reviews| 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..39cbfc6bb97a806734e429016055d2d266d8d569 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,9 @@ bool IsVisible(gfx::NativeView view) { |
| return true; |
| } |
| +bool RegisterPlatformUtil(JNIEnv* env) { |
| + return RegisterNativesImpl(env); |
| +} |
| + |
|
sky
2015/09/08 15:09:14
nit: only one newline here.
|
| + |
| } // namespace platform_util |