Roll src/third_party/WebKit a452221:9ff6d11 (svn 202117:202119)
[chromium-blink-merge.git] / mandoline / app / android / mandoline_activity.cc
blob0d05724fcf4b00c2cf22a0ca7bc8cea70cd516ee
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
3 // found in the LICENSE file.
5 #include "base/android/jni_string.h"
6 #include "jni/MandolineActivity_jni.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"
11 namespace mandoline {
13 static void LaunchURL(JNIEnv* env,
14 const JavaParamRef<jclass>& clazz,
15 const JavaParamRef<jstring>& jurl) {
16 LaunchHandlerPtr launch_handler;
17 mojo::runner::GetContext()->application_manager()->ConnectToService(
18 GURL("mojo:phone_ui"), &launch_handler);
19 launch_handler->LaunchURL(
20 base::android::ConvertJavaStringToUTF8(env, jurl));
23 bool RegisterMandolineActivity(JNIEnv* env) {
24 return RegisterNativesImpl(env);
27 } // namespace mandoline