New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 624407 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Resigned
Closed: Aug 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Feature



Sign in to add a comment

Expose JNI bindigs for url_formatter

Reported by ingem...@opera.com, Jun 29 2016

Issue description

There are some handy utility methods for formatting urls available in //components/url_formatter which would also be nice to have in Java land. Chrome provides a subset of these in org.chromium.chrome.browser.util.UrlUtilities, but it would probably make sense to expose these directly from the component instead, allowing non-Chrome embedders (such as Opera) to use them without having to duplicate the JNI boilerplate.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Aug 25 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b232498ead0784193c039ea1997ecafc391503ef

commit b232498ead0784193c039ea1997ecafc391503ef
Author: ingemara <ingemara@opera.com>
Date: Thu Aug 25 08:13:37 2016

Move JNI bindings for url_formatter from chrome to //components/url_formatter

By moving the url_formatter methods out of
org.chromium.chrome.browser.UrlUtilities to it's component, other emdedders than
Chrome can benefit from the Java version.

This CL removes the tests originally written for a Java implementation of the
methods replaced by FormatUrlForSecurityDisplay in
https://codereview.chromium.org/1357563002. It's not trivial to move the tests
over to the component as they depend on native library initialization performed
by //content which is disallowed in components/url_formatter/DEPS. Also, the
tests are redundant as the code is thoroughly tested by other means.

Currently there are no users of formatUrlForDisplay() in Chromium, but Opera
would like it exposed.

BUG= 624407 

Review-Url: https://codereview.chromium.org/2110543004
Cr-Commit-Position: refs/heads/master@{#414356}

[modify] https://crrev.com/b232498ead0784193c039ea1997ecafc391503ef/chrome/android/BUILD.gn
[modify] https://crrev.com/b232498ead0784193c039ea1997ecafc391503ef/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkEditActivity.java
[modify] https://crrev.com/b232498ead0784193c039ea1997ecafc391503ef/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadHistoryAdapter.java
[modify] https://crrev.com/b232498ead0784193c039ea1997ecafc391503ef/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionTabHelper.java
[modify] https://crrev.com/b232498ead0784193c039ea1997ecafc391503ef/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java
[modify] https://crrev.com/b232498ead0784193c039ea1997ecafc391503ef/chrome/android/java/src/org/chromium/chrome/browser/pageinfo/WebsiteSettingsPopup.java
[modify] https://crrev.com/b232498ead0784193c039ea1997ecafc391503ef/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
[modify] https://crrev.com/b232498ead0784193c039ea1997ecafc391503ef/chrome/android/java/src/org/chromium/chrome/browser/preferences/HomepageEditor.java
[modify] https://crrev.com/b232498ead0784193c039ea1997ecafc391503ef/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java
[modify] https://crrev.com/b232498ead0784193c039ea1997ecafc391503ef/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java
[modify] https://crrev.com/b232498ead0784193c039ea1997ecafc391503ef/chrome/android/java/src/org/chromium/chrome/browser/util/UrlUtilities.java
[modify] https://crrev.com/b232498ead0784193c039ea1997ecafc391503ef/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappUrlBar.java
[modify] https://crrev.com/b232498ead0784193c039ea1997ecafc391503ef/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridgeTest.java
[modify] https://crrev.com/b232498ead0784193c039ea1997ecafc391503ef/chrome/android/javatests/src/org/chromium/chrome/browser/util/UrlUtilitiesTest.java
[modify] https://crrev.com/b232498ead0784193c039ea1997ecafc391503ef/chrome/browser/android/chrome_jni_registrar.cc
[modify] https://crrev.com/b232498ead0784193c039ea1997ecafc391503ef/chrome/browser/android/url_utilities.cc
[modify] https://crrev.com/b232498ead0784193c039ea1997ecafc391503ef/chrome/chrome.gyp
[modify] https://crrev.com/b232498ead0784193c039ea1997ecafc391503ef/components/url_formatter/BUILD.gn
[modify] https://crrev.com/b232498ead0784193c039ea1997ecafc391503ef/components/url_formatter/DEPS
[add] https://crrev.com/b232498ead0784193c039ea1997ecafc391503ef/components/url_formatter/android/BUILD.gn
[add] https://crrev.com/b232498ead0784193c039ea1997ecafc391503ef/components/url_formatter/android/component_jni_registrar.cc
[add] https://crrev.com/b232498ead0784193c039ea1997ecafc391503ef/components/url_formatter/android/component_jni_registrar.h
[add] https://crrev.com/b232498ead0784193c039ea1997ecafc391503ef/components/url_formatter/android/java/src/org/chromium/components/url_formatter/UrlFormatter.java
[modify] https://crrev.com/b232498ead0784193c039ea1997ecafc391503ef/components/url_formatter/url_formatter.gyp
[add] https://crrev.com/b232498ead0784193c039ea1997ecafc391503ef/components/url_formatter/url_formatter_android.cc
[add] https://crrev.com/b232498ead0784193c039ea1997ecafc391503ef/components/url_formatter/url_formatter_android.h

Comment 2 by ingem...@opera.com, Aug 25 2016

Status: Fixed (was: Untriaged)

Sign in to add a comment