Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Unified Diff: net/android/java/src/org/chromium/net/GURLUtils.java

Issue 11416347: Adding java implementation for Geolocation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated comment and copyright date Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/android/java/src/org/chromium/net/GURLUtils.java
diff --git a/net/android/java/src/org/chromium/net/GURLUtils.java b/net/android/java/src/org/chromium/net/GURLUtils.java
new file mode 100644
index 0000000000000000000000000000000000000000..8047ad3336ccd566648b7987c9c8812c6ab69a64
--- /dev/null
+++ b/net/android/java/src/org/chromium/net/GURLUtils.java
@@ -0,0 +1,27 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.net;
+
+import org.chromium.base.JNINamespace;
+
+/**
+ * Class to access the GURL library from java.
+ */
+@JNINamespace("net")
+public final class GURLUtils {
+
+ /**
+ * Get the origin of an url: Ex getOrigin("http://www.example.com:8080/index.html?bar=foo")
+ * would return "http://www.example.com:8080". It will return an empty string for an
+ * invalid url.
+ *
+ * @return The origin of the url
+ */
+ public static String getOrigin(String url) {
+ return nativeGetOrigin(url);
+ }
+
+ private static native String nativeGetOrigin(String url);
+}

Powered by Google App Engine
This is Rietveld 408576698