Closed Bug 913214 Opened 12 years ago Closed 12 years ago

Create StringUtils method to provide readable URL / title string

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 27

People

(Reporter: capella, Assigned: capella)

Details

Attachments

(1 file, 2 obsolete files)

Small code cleanup / followup from bug 912523 to avoid duplication of URL string methods
Attached patch bug913214 v1 (obsolete) — Splinter Review
For your reviewing pleasure ...
Attachment #800420 - Flags: review?(wjohnston)
Attachment #800420 - Flags: review?(sriram)
Comment on attachment 800420 [details] [diff] [review] bug913214 v1 You could convert these two single calls to the new combined method as well, right? http://dxr.mozilla.org/mozilla-central/source/mobile/android/base/BrowserToolbar.java#l1084
ick ... forgot to grab that ...
Attached patch bug913214 v2 (obsolete) — Splinter Review
Incorporate code from comment #2 .... sorry for the bugzilla churn
Attachment #800420 - Attachment is obsolete: true
Attachment #800420 - Flags: review?(wjohnston)
Attachment #800420 - Flags: review?(sriram)
Attachment #800744 - Flags: review?(wjohnston)
Attachment #800744 - Flags: review?(sriram)
Comment on attachment 800744 [details] [diff] [review] bug913214 v2 Review of attachment 800744 [details] [diff] [review]: ----------------------------------------------------------------- I think maybe we could strip https in the urlbar, but I'd rather do it explicitly in a different bug where we can get some ux/sec review. ::: mobile/android/base/util/StringUtils.java @@ +56,5 @@ > int end = url.length(); > > if (url.startsWith("http://")) { > start = 7; > + } else if (url.startsWith("https://")) { Hmm... so we intentionally don't do this in the urlbar for security reasons (although I kinda want to do it anyway, and we already show a lock there...). I would suggest, if we want it gone in some places, but not others that you add a flag to this method and then overload it. i.e. class UrlFlags { public static final int NONE = 0; public static final int STRIP_HTTPS = 1; // (or maybe DONT_STRIP_HTTPS?) } stripScheme(String url) { return stripScheme(url, UrlFlags.NONE); } stripScheme(String url, int flags) { // ... else if (url.startsWith("https://") && flags == UrlFlags.STRIP_HTTPS) { } // ... }
Attachment #800744 - Flags: review?(wjohnston)
Attached patch bug913214 v3Splinter Review
As requested, a little more tighter. I agree it's hacky with the security conscious flag ... I'd like very much to follow-up and file that "explicitly different bug where we can get some ux/sec review".
Attachment #800744 - Attachment is obsolete: true
Attachment #800744 - Flags: review?(sriram)
Attachment #801005 - Flags: review?(wjohnston)
Attachment #801005 - Flags: review?(sriram)
Attachment #801005 - Flags: review?(wjohnston) → review+
Comment on attachment 801005 [details] [diff] [review] bug913214 v3 Review of attachment 801005 [details] [diff] [review]: ----------------------------------------------------------------- This looks good to me. Though I would like to use enums.
Attachment #801005 - Flags: review?(sriram) → review+
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 27
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: