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

Unified Diff: chrome/browser/android/most_visited_sites.cc

Issue 1030713002: [Suggestions] Remove support for a Control logging group. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clean up one more test 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
Index: chrome/browser/android/most_visited_sites.cc
diff --git a/chrome/browser/android/most_visited_sites.cc b/chrome/browser/android/most_visited_sites.cc
index 3e01aaf85c7fb270658d92795a1b4d76d82c1e91..8ce0f8d716c5eb8221a48e643b82eb0bba875190 100644
--- a/chrome/browser/android/most_visited_sites.cc
+++ b/chrome/browser/android/most_visited_sites.cc
@@ -61,8 +61,6 @@ const char kNumEmptyTilesHistogramName[] = "NewTabPage.NumberOfGrayTiles";
const char kNumServerTilesHistogramName[] = "NewTabPage.NumberOfExternalTiles";
// Client suggestion opened.
const char kOpenedItemClientHistogramName[] = "NewTabPage.MostVisited.client";
-// Control group suggestion opened.
-const char kOpenedItemControlHistogramName[] = "NewTabPage.MostVisited.client0";
// Server suggestion opened, no provider.
const char kOpenedItemServerHistogramName[] = "NewTabPage.MostVisited.server";
// Server suggestion opened with provider.
@@ -71,9 +69,6 @@ const char kOpenedItemServerProviderHistogramFormat[] =
// Client impression.
const char kImpressionClientHistogramName[] =
"NewTabPage.SuggestionsImpression.client";
-// Control group impression.
-const char kImpressionControlHistogramName[] =
- "NewTabPage.SuggestionsImpression.client0";
// Server suggestion impression, no provider.
const char kImpressionServerHistogramName[] =
"NewTabPage.SuggestionsImpression.server";
@@ -189,9 +184,9 @@ SyncState GetSyncState(Profile* profile) {
} // namespace
MostVisitedSites::MostVisitedSites(Profile* profile)
- : profile_(profile), num_sites_(0), is_control_group_(false),
- initial_load_done_(false), num_local_thumbs_(0), num_server_thumbs_(0),
- num_empty_thumbs_(0), scoped_observer_(this), weak_ptr_factory_(this) {
+ : profile_(profile), num_sites_(0), initial_load_done_(false),
+ num_local_thumbs_(0), num_server_thumbs_(0), num_empty_thumbs_(0),
+ scoped_observer_(this), weak_ptr_factory_(this) {
// Register the debugging page for the Suggestions Service and the thumbnails
// debugging page.
content::URLDataSource::Add(profile_,
@@ -316,9 +311,7 @@ void MostVisitedSites::RecordOpenedMostVisitedItem(JNIEnv* env,
jint index) {
switch (mv_source_) {
case TOP_SITES: {
- const std::string histogram = is_control_group_ ?
- kOpenedItemControlHistogramName : kOpenedItemClientHistogramName;
- LogHistogramEvent(histogram, index, num_sites_);
+ UMA_HISTOGRAM_SPARSE_SLOWLY(kOpenedItemClientHistogramName, index);
break;
}
case SUGGESTIONS_SERVICE: {
@@ -393,10 +386,8 @@ void MostVisitedSites::OnMostVisitedURLsAvailable(
if (!initial_load_done_) {
int num_tiles = urls.size();
UMA_HISTOGRAM_SPARSE_SLOWLY(kNumTilesHistogramName, num_tiles);
- const std::string histogram = is_control_group_ ?
- kImpressionControlHistogramName : kImpressionClientHistogramName;
for (int i = 0; i < num_tiles; ++i) {
- LogHistogramEvent(histogram, i, num_sites_);
+ UMA_HISTOGRAM_SPARSE_SLOWLY(kImpressionClientHistogramName, i);
}
}
initial_load_done_ = true;
@@ -412,24 +403,10 @@ void MostVisitedSites::OnMostVisitedURLsAvailable(
void MostVisitedSites::OnSuggestionsProfileAvailable(
ScopedJavaGlobalRef<jobject>* j_observer,
const SuggestionsProfile& suggestions_profile) {
- int size = suggestions_profile.suggestions_size();
-
- // Determine if the user is in a control group (they would have received
- // suggestions, but are in a group where they shouldn't).
- is_control_group_ = size && SuggestionsService::IsControlGroup();
-
- // If no suggestions data is available or the user is in a control group,
- // initiate Top Sites query.
- if (is_control_group_ || !size) {
- InitiateTopSitesQuery();
- return;
- }
-
std::vector<base::string16> titles;
huangs 2015/03/24 15:17:26 So if size == 0 you no longer need to call Initiat
Mathieu 2015/03/24 15:26:16 Done. Gosh, I feel so silly :\
std::vector<std::string> urls;
-
int i = 0;
- for (; i < size && i < num_sites_; ++i) {
+ for (; i < suggestions_profile.suggestions_size() && i < num_sites_; ++i) {
const ChromeSuggestion& suggestion = suggestions_profile.suggestions(i);
titles.push_back(base::UTF8ToUTF16(suggestion.title()));
urls.push_back(suggestion.url());

Powered by Google App Engine
This is Rietveld 408576698