mandoline: Allow running the aura/views UI on android.
[chromium-blink-merge.git] / net / android / gurl_utils.cc
blobc8cb1e4e9981bc51bee260cfad18e70076f0b72b
1 // Copyright (c) 2012 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 "net/android/gurl_utils.h"
7 #include "base/android/jni_string.h"
8 #include "jni/GURLUtils_jni.h"
9 #include "url/gurl.h"
11 namespace net {
13 jstring GetOrigin(JNIEnv* env, jclass clazz, jstring url) {
14 GURL host(base::android::ConvertJavaStringToUTF16(env, url));
16 return base::android::ConvertUTF8ToJavaString(env,
17 host.GetOrigin().spec()).Release();
20 jstring GetScheme(JNIEnv* env, jclass clazz, jstring url) {
21 GURL host(base::android::ConvertJavaStringToUTF16(env, url));
23 return base::android::ConvertUTF8ToJavaString(env,
24 host.scheme()).Release();
27 bool RegisterGURLUtils(JNIEnv* env) {
28 return RegisterNativesImpl(env);
31 } // net namespace