OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_HISTORY_MOST_VISITED_TILES_EXPERIMENT_H_ | |
6 #define CHROME_BROWSER_HISTORY_MOST_VISITED_TILES_EXPERIMENT_H_ | |
7 | |
8 #include "base/values.h" | |
9 #include "chrome/browser/history/history_types.h" | |
10 #include "chrome/common/instant_types.h" | |
11 | |
12 class ListValue; | |
13 class InstantMostVisitedItem; | |
14 | |
15 namespace history { | |
16 | |
17 // Class for implementing the Most Visited Tile Placement experiment. | |
18 class MostVisitedTilesExperiment { | |
19 public: | |
20 // Helper method to shuffle MostVisited tiles for A/B testing purposes. | |
21 static void MaybeShuffle(MostVisitedURLList* data); | |
22 | |
23 // Returns true if this user is part of the Most Visited Tile Placement | |
24 // experiment group where URLs currently open in another browser tab are not | |
25 // displayed on an NTP tile. Note: the experiment targets only the top-level | |
26 // of sites i.e. if www.foo.com/bar is open in browser, and www.foo.com is a | |
27 // recommended URL, www.foo.com will still appear on the next NTP open. The | |
28 // experiment will not remove a URL if doing so would cause the number of Most | |
29 // Visited recommendations to drop below eight. | |
30 static bool DontShowOpenURLsEnabled(); | |
sky
2013/07/17 21:30:51
IsDoneShowOpenURLsEnabled?
annark1
2013/07/22 20:35:34
Done.
| |
31 | |
32 // Removes URLs already open in browser, for 1993 clients, if part of | |
33 // experiment described for DontShowOpenURLsEnabled(). | |
34 static void RemoveItemsMatchingOpenTabs( | |
35 const std::set<std::string>& open_urls, | |
36 std::vector<InstantMostVisitedItem>* items); | |
37 | |
38 // Removes URLs already open in browser, for non-1993 clients, if part of | |
39 // experiment described for DontShowOpenURLsEnabled(). | |
40 static void RemovePageValuesMatchingOpenTabs( | |
41 const std::set<std::string>& open_urls, | |
42 base::ListValue* pages_value); | |
43 | |
44 private: | |
45 // This enum is also defined in histograms.xml. These values represent the | |
46 // types of actions carried out by the Most Visited Tile Placement experiment. | |
47 enum NtpTileExperimentActions { | |
48 NTP_TILE_EXPERIMENT_ACTION_REMOVED_URL = 0, | |
49 NTP_TILE_EXPERIMENT_ACTION_DID_NOT_REMOVE_URL = 1, | |
50 NTP_TILE_EXPERIMENT_ACTION_TOO_FEW_URLS_TILES_1_8 = 2, | |
51 NTP_TILE_EXPERIMENT_ACTION_TOO_FEW_URLS_TILES_1_4 = 3, | |
52 NTP_TILE_EXPERIMENT_ACTION_NO_URL_TO_FLIP = 4, | |
53 // The number of Most Visited Tile Placement experiment actions logged. | |
54 NUM_NTP_TILE_EXPERIMENT_ACTIONS | |
55 }; | |
56 | |
57 // Helper method to log the actions carried out by the Most Visited Tile | |
58 // Placement experiment. | |
59 static void LogInHistogram(NtpTileExperimentActions action); | |
60 | |
sky
2013/07/17 21:30:51
DISALLOW_IMPLICIT_CONSTRUCTORS, or make this a bun
annark1
2013/07/22 20:35:34
Done.
| |
61 }; | |
62 | |
63 } // namespace history | |
64 | |
65 #endif // CHROME_BROWSER_HISTORY_MOST_VISITED_TILES_EXPERIMENT_H_ | |
OLD | NEW |