gurl_utils.cc revision 2a99a7e74a7f215066514fe81d2bfa6639d9eddd
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.
4
5#include "net/android/gurl_utils.h"
6
7#include "base/android/jni_string.h"
8#include "googleurl/src/gurl.h"
9#include "jni/GURLUtils_jni.h"
10
11namespace net {
12
13jstring GetOrigin(JNIEnv* env, jclass clazz, jstring url) {
14  GURL host(base::android::ConvertJavaStringToUTF16(env, url));
15
16  return base::android::ConvertUTF8ToJavaString(env,
17      host.GetOrigin().spec()).Release();
18}
19
20bool RegisterGURLUtils(JNIEnv* env) {
21  return RegisterNativesImpl(env);
22}
23
24}  // net namespace
25