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

Unified Diff: chrome/browser/history/top_sites.h

Issue 17114002: Field trial removing tiles from NTP if URL is already open - for 1993 clients (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed rebase issues Created 7 years, 5 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 | chrome/browser/history/top_sites.cc » ('j') | chrome/browser/history/top_sites.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/top_sites.h
diff --git a/chrome/browser/history/top_sites.h b/chrome/browser/history/top_sites.h
index b55821d34798adb34bb354e4d74308218cc4f691..539a37d14301610d627859db054153bcbb468199 100644
--- a/chrome/browser/history/top_sites.h
+++ b/chrome/browser/history/top_sites.h
@@ -12,6 +12,7 @@
#include "chrome/browser/common/cancelable_request.h"
#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_types.h"
+#include "chrome/common/instant_types.h"
#include "chrome/common/thumbnail_score.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/image/image.h"
@@ -47,6 +48,27 @@ class TopSites
// Helper method to shuffle MostVisited tiles for A/B testing purposes.
static void MaybeShuffle(MostVisitedURLList* data);
+ // Returns true if this user is part of the Most Visited Tile Placement
+ // experiment group where URLs currently open in the browser are not displayed
+ // on the NTP. Note: the experiment targets only the top-level of sites i.e.
+ // if www.foo.com/bar is open in browser, and www.foo.com is a recommended
+ // URL, www.foo.com will still appear on the next NTP open. The experiment
+ // will not remove a URL if doing so would cause the number of Most Visited
+ // recommendations to drop below eight.
+ static bool IsClientInTabsGroup();
+
+ // Removes URLs already open in browser, for 1993 clients, if part of
+ // experiment described for IsClientInTabsGroup().
+ static void RemoveItemsMatchingOpenTabs(
+ const std::set<std::string>& open_urls,
+ std::vector<InstantMostVisitedItem>* items);
+
+ // Removes URLs already open in browser, for non-1993 clients, if part of
+ // experiment described for IsClientInTabsGroup().
+ static void RemovePageValuesMatchingOpenTabs(
+ const std::set<std::string>& open_urls,
+ base::ListValue* pages_value);
+
// Sets the given thumbnail for the given URL. Returns true if the thumbnail
// was updated. False means either the URL wasn't known to us, or we felt
// that our current thumbnail was superior to the given one. Should be called
@@ -172,6 +194,18 @@ class TopSites
private:
friend class base::RefCountedThreadSafe<TopSites>;
+
+ // This enum is also defined in histograms.xml. These values represent the
+ // types of actions carried out by the Most Visited Tile Placement experiment.
+ enum NtpTileExperimentActions {
+ NTP_TILE_EXPERIMENT_ACTION_REMOVED_URL = 0,
+ NTP_TILE_EXPERIMENT_ACTION_DID_NOT_REMOVE_URL = 1,
+ NTP_TILE_EXPERIMENT_ACTION_TOO_FEW_URLS_TILES_1_8 = 2,
+ NTP_TILE_EXPERIMENT_ACTION_TOO_FEW_URLS_TILES_1_4 = 3,
+ NTP_TILE_EXPERIMENT_ACTION_NO_URL_TO_FLIP = 4,
+ // The number of Most Visited Tile Placement experiment actions logged.
+ NUM_NTP_TILE_EXPERIMENT_ACTIONS
+ };
};
#if defined(OS_ANDROID)
« no previous file with comments | « no previous file | chrome/browser/history/top_sites.cc » ('j') | chrome/browser/history/top_sites.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698