Commit fe1f5975 authored by Dmitry Titov's avatar Dmitry Titov Committed by Commit Bot

Fix bounds and bucket numbers for Explore Sites linear histograms to avoid DCHECK.

Bug: 896481
Change-Id: Ib5cc008bdc896632b4ae65c14091af9cad343ee1
Reviewed-on: https://chromium-review.googlesource.com/c/1300112Reviewed-by: default avatarJustin DeWitt <dewittj@chromium.org>
Commit-Queue: Dmitry Titov <dimich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603217}
parent 20bb4123
...@@ -228,6 +228,6 @@ public class ExploreSitesCategoryCardView extends LinearLayout { ...@@ -228,6 +228,6 @@ public class ExploreSitesCategoryCardView extends LinearLayout {
// TODO(petewil): Should I get the number of sites in this category from the model instead // TODO(petewil): Should I get the number of sites in this category from the model instead
// of using MAX_TILE_COUNT? // of using MAX_TILE_COUNT?
RecordHistogram.recordLinearCountHistogram("ExploreSites.SiteTilesClickIndex", RecordHistogram.recordLinearCountHistogram("ExploreSites.SiteTilesClickIndex",
cardIndex * MAX_TILE_COUNT + tileIndex, 0, 100, 100); cardIndex * MAX_TILE_COUNT + tileIndex, 1, 100, 100);
} }
} }
...@@ -36,11 +36,6 @@ import java.util.Map; ...@@ -36,11 +36,6 @@ import java.util.Map;
public class ExploreSitesSection { public class ExploreSitesSection {
private static final String TAG = "ExploreSitesSection"; private static final String TAG = "ExploreSitesSection";
private static final int MAX_CATEGORIES = 3; private static final int MAX_CATEGORIES = 3;
// This is a number of UMA histogram buckets that should be an upper bound
// of MAX_CATEGORIES over time, plus 1 for "More" button, and plus 1 for
// overflow bucket. If MAX_CATEGORIES changes, this value should be updated
// only upwards.
private static final int MAX_CATEGORIES_HISTOGRAM_BUCKETS = 5;
@TileStyle @TileStyle
private int mStyle; private int mStyle;
...@@ -194,8 +189,8 @@ public class ExploreSitesSection { ...@@ -194,8 +189,8 @@ public class ExploreSitesSection {
} }
private void onClicked(int tileIndex, ExploreSitesCategory category, View v) { private void onClicked(int tileIndex, ExploreSitesCategory category, View v) {
RecordHistogram.recordLinearCountHistogram("ExploreSites.ClickedNTPCategoryIndex", RecordHistogram.recordLinearCountHistogram(
tileIndex, 0, MAX_CATEGORIES, MAX_CATEGORIES_HISTOGRAM_BUCKETS); "ExploreSites.ClickedNTPCategoryIndex", tileIndex, 1, 100, 100);
mNavigationDelegate.openUrl(WindowOpenDisposition.CURRENT_TAB, mNavigationDelegate.openUrl(WindowOpenDisposition.CURRENT_TAB,
new LoadUrlParams(category.getUrl(), PageTransition.AUTO_BOOKMARK)); new LoadUrlParams(category.getUrl(), PageTransition.AUTO_BOOKMARK));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment