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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java

Issue 1056743002: Improve whitespace matching for encoding Android page info popup URLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java b/chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java
index 8f456d0018dc72fab814a2c6b5d4f78cd2b4339d..b4bcfc66cdce03b0a797267faa19e612f00d6051 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java
@@ -165,10 +165,6 @@ public class WebsiteSettingsPopup implements OnClickListener, OnItemSelectedList
private static final int MAX_TABLET_DIALOG_WIDTH_DP = 400;
- private static final char FIRST_UNICODE_WHITESPACE = '\u2000';
- private static final char FINAL_UNICODE_WHITESPACE = '\u200F';
- private static final char UNICODE_NBSP = '\u00A0';
-
private final Context mContext;
private final Profile mProfile;
private final WebContents mWebContents;
@@ -313,10 +309,7 @@ public class WebsiteSettingsPopup implements OnClickListener, OnItemSelectedList
StringBuilder urlBuilder = new StringBuilder();
for (int i = 0; i < urlStr.length(); i++) {
char c = urlStr.charAt(i);
- if ((c >= FIRST_UNICODE_WHITESPACE
- && c <= FINAL_UNICODE_WHITESPACE)
- || c == ' '
- || c == UNICODE_NBSP) {
+ if (Character.isSpaceChar(c)) {
urlBuilder.append(Uri.encode(Character.toString(c)));
} else {
urlBuilder.append(c);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698