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 04a0f0d7b6bbced1092aba9db107d42baa0b12b1..cb2bf7c6e86fabab37a603b8b28694317a867803 100644 |
| --- a/chrome/browser/platform_util_android.cc |
| +++ b/chrome/browser/platform_util_android.cc |
| @@ -8,9 +8,12 @@ |
| #include "base/android/jni_string.h" |
| #include "base/logging.h" |
| #include "chrome/browser/platform_util.h" |
| +#include "url/gurl.h" |
| + |
| +#if defined(ANDROID_JAVA_UI) |
| #include "jni/PlatformUtil_jni.h" |
| #include "ui/android/view_android.h" |
| -#include "url/gurl.h" |
| +#endif |
| namespace platform_util { |
|
Ted C
2015/11/30 19:39:05
To me, it looks like you shouldn't be using this c
no sievers
2015/11/30 23:56:34
Makes sense. Changes reverted.
|
| @@ -28,15 +31,22 @@ void OpenItem(Profile* profile, |
| } |
| void OpenExternal(Profile* profile, const GURL& url) { |
| +#if defined(ANDROID_JAVA_UI) |
| JNIEnv* env = base::android::AttachCurrentThread(); |
| ScopedJavaLocalRef<jstring> j_url = |
| base::android::ConvertUTF8ToJavaString(env, url.spec()); |
| Java_PlatformUtil_launchExternalProtocol(env, j_url.obj()); |
| +#endif |
| } |
| gfx::NativeWindow GetTopLevel(gfx::NativeView view) { |
| +#if defined(ANDROID_JAVA_UI) |
| NOTIMPLEMENTED(); |
| return view->GetWindowAndroid(); |
| +#else |
| + NOTIMPLEMENTED(); |
| + return nullptr; |
| +#endif |
| } |
| gfx::NativeView GetParent(gfx::NativeView view) { |
| @@ -58,8 +68,10 @@ bool IsVisible(gfx::NativeView view) { |
| return true; |
| } |
| +#if defined(ANDROID_JAVA_UI) |
| bool RegisterPlatformUtil(JNIEnv* env) { |
| return RegisterNativesImpl(env); |
| } |
| +#endif |
| } // namespace platform_util |