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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionSiteBreakdownView.java

Issue 2953523002: Add 'Other' category on the Data Saver site-breakdown page (Closed)
Patch Set: Created 3 years, 6 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 | components/data_reduction_proxy/core/browser/data_reduction_proxy_data_use_observer.cc » ('j') | 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/preferences/datareduction/DataReductionSiteBreakdownView.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionSiteBreakdownView.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionSiteBreakdownView.java
index 8450c91e4fced05e1997bab2228d9f4ac7ea98e9..d75fea440156ca897faf2757df7394886a34e0b6 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionSiteBreakdownView.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionSiteBreakdownView.java
@@ -30,6 +30,11 @@ import java.util.List;
*/
public class DataReductionSiteBreakdownView extends LinearLayout {
private static final int NUM_DATA_USE_ITEMS_TO_ADD = 10;
+
+ // Hostname used for the other bucket which consists of chrome-services traffic.
+ // This should be in sync with the same in DataReductionProxyDataUseObserver.
+ private static final String OTHER_HOST_NAME = "Other";
rajendrant 2017/06/20 23:24:25 Not sure if a new string should be added in androi
megjablon 2017/06/20 23:45:46 This should definitely be translated. It will prob
rajendrant 2017/06/21 00:30:31 OK. I am adding an entry in android_chrome_strings
+
private int mNumDataUseItemsToDisplay = 10;
private TableLayout mTableLayout;
@@ -130,7 +135,11 @@ public class DataReductionSiteBreakdownView extends LinearLayout {
implements Comparator<DataReductionDataUseItem>, Serializable {
@Override
public int compare(DataReductionDataUseItem lhs, DataReductionDataUseItem rhs) {
megjablon 2017/06/20 23:45:46 Please add a comment as to what this is doing. At
rajendrant 2017/06/21 00:30:31 Done.
- if (lhs.getDataUsed() < rhs.getDataUsed()) {
+ if (OTHER_HOST_NAME.equals(lhs.getHostname())) {
+ return 1;
+ } else if (OTHER_HOST_NAME.equals(rhs.getHostname())) {
+ return -1;
+ } else if (lhs.getDataUsed() < rhs.getDataUsed()) {
return 1;
} else if (lhs.getDataUsed() > rhs.getDataUsed()) {
return -1;
@@ -147,7 +156,11 @@ public class DataReductionSiteBreakdownView extends LinearLayout {
implements Comparator<DataReductionDataUseItem>, Serializable {
@Override
public int compare(DataReductionDataUseItem lhs, DataReductionDataUseItem rhs) {
megjablon 2017/06/20 23:45:46 Also a comment here.
rajendrant 2017/06/21 00:30:31 Done.
- if (lhs.getDataSaved() < rhs.getDataSaved()) {
+ if (OTHER_HOST_NAME.equals(lhs.getHostname())) {
+ return 1;
+ } else if (OTHER_HOST_NAME.equals(rhs.getHostname())) {
+ return -1;
+ } else if (lhs.getDataSaved() < rhs.getDataSaved()) {
return 1;
} else if (lhs.getDataSaved() > rhs.getDataSaved()) {
return -1;
@@ -228,4 +241,4 @@ public class DataReductionSiteBreakdownView extends LinearLayout {
mTableLayout.requestLayout();
}
-}
+}
« no previous file with comments | « no previous file | components/data_reduction_proxy/core/browser/data_reduction_proxy_data_use_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698