OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/android/jni_string.h" | 5 #include "base/android/jni_string.h" |
6 #include "jni/MandolineActivity_jni.h" | 6 #include "jni/MandolineActivity_jni.h" |
7 #include "mandoline/ui/desktop_ui/public/interfaces/launch_handler.mojom.h" | 7 #include "mandoline/ui/desktop_ui/public/interfaces/launch_handler.mojom.h" |
8 #include "mojo/runner/android/main.h" | |
9 #include "mojo/runner/context.h" | |
10 #include "mojo/shell/connect_util.h" | 8 #include "mojo/shell/connect_util.h" |
| 9 #include "mojo/shell/standalone/android/main.h" |
| 10 #include "mojo/shell/standalone/context.h" |
11 | 11 |
12 namespace mandoline { | 12 namespace mandoline { |
13 | 13 |
14 static void LaunchURL(JNIEnv* env, | 14 static void LaunchURL(JNIEnv* env, |
15 const JavaParamRef<jclass>& clazz, | 15 const JavaParamRef<jclass>& clazz, |
16 const JavaParamRef<jstring>& jurl) { | 16 const JavaParamRef<jstring>& jurl) { |
17 LaunchHandlerPtr launch_handler; | 17 LaunchHandlerPtr launch_handler; |
18 mojo::shell::ConnectToService( | 18 mojo::shell::ConnectToService( |
19 mojo::runner::GetContext()->application_manager(), GURL("mojo:phone_ui"), | 19 mojo::shell::GetContext()->application_manager(), GURL("mojo:phone_ui"), |
20 &launch_handler); | 20 &launch_handler); |
21 launch_handler->LaunchURL( | 21 launch_handler->LaunchURL( |
22 base::android::ConvertJavaStringToUTF8(env, jurl)); | 22 base::android::ConvertJavaStringToUTF8(env, jurl)); |
23 } | 23 } |
24 | 24 |
25 bool RegisterMandolineActivity(JNIEnv* env) { | 25 bool RegisterMandolineActivity(JNIEnv* env) { |
26 return RegisterNativesImpl(env); | 26 return RegisterNativesImpl(env); |
27 } | 27 } |
28 | 28 |
29 } // namespace mandoline | 29 } // namespace mandoline |
OLD | NEW |