Index: components/ntp_tiles/most_visited_sites.cc |
diff --git a/components/ntp_tiles/most_visited_sites.cc b/components/ntp_tiles/most_visited_sites.cc |
index fab0384830af66c9f4734e5eaff4f07c9ae6be3a..047fcec1df227ed30afe07d255172f0c3cd136ad 100644 |
--- a/components/ntp_tiles/most_visited_sites.cc |
+++ b/components/ntp_tiles/most_visited_sites.cc |
@@ -9,18 +9,12 @@ |
#include <string> |
#include <utility> |
-#if defined(OS_ANDROID) |
-#include <jni.h> |
-#endif |
- |
#include "base/callback.h" |
-#include "base/command_line.h" |
#include "base/feature_list.h" |
-#include "base/metrics/field_trial.h" |
-#include "base/strings/string_util.h" |
#include "base/strings/utf_string_conversions.h" |
#include "components/history/core/browser/top_sites.h" |
#include "components/ntp_tiles/constants.h" |
+#include "components/ntp_tiles/field_trial.h" |
#include "components/ntp_tiles/icon_cacher.h" |
#include "components/ntp_tiles/metrics.h" |
#include "components/ntp_tiles/pref_names.h" |
@@ -28,11 +22,6 @@ |
#include "components/pref_registry/pref_registry_syncable.h" |
#include "components/prefs/pref_service.h" |
-#if defined(OS_ANDROID) |
-#include "base/android/jni_android.h" |
-#include "jni/MostVisitedSites_jni.h" |
-#endif |
- |
using history::TopSites; |
using suggestions::ChromeSuggestion; |
using suggestions::SuggestionsProfile; |
@@ -45,30 +34,6 @@ namespace { |
const base::Feature kDisplaySuggestionsServiceTiles{ |
"DisplaySuggestionsServiceTiles", base::FEATURE_ENABLED_BY_DEFAULT}; |
-bool ShouldShowPopularSites() { |
- // Note: It's important to query the field trial state first, to ensure that |
- // UMA reports the correct group. |
- const std::string group_name = |
- base::FieldTrialList::FindFullName(kPopularSitesFieldTrialName); |
- |
- base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); |
- if (cmd_line->HasSwitch(switches::kDisableNTPPopularSites)) |
- return false; |
- |
- if (cmd_line->HasSwitch(switches::kEnableNTPPopularSites)) |
- return true; |
- |
-#if defined(OS_ANDROID) |
- if (Java_MostVisitedSites_isPopularSitesForceEnabled( |
- base::android::AttachCurrentThread())) { |
- return true; |
- } |
-#endif |
- |
- return base::StartsWith(group_name, "Enabled", |
- base::CompareCase::INSENSITIVE_ASCII); |
-} |
- |
// Determine whether we need any tiles from PopularSites to fill up a grid of |
// |num_tiles| tiles. |
bool NeedPopularSites(const PrefService* prefs, int num_tiles) { |
@@ -120,8 +85,8 @@ void MostVisitedSites::SetMostVisitedURLsObserver(Observer* observer, |
observer_ = observer; |
num_sites_ = num_sites; |
- if (popular_sites_ && ShouldShowPopularSites() && |
- NeedPopularSites(prefs_, num_sites_)) { |
+ if (popular_sites_ && NeedPopularSites(prefs_, num_sites_) && |
+ ShouldShowPopularSites()) { |
noyau (Ping after 24h)
2016/11/09 10:56:39
I changed the order of the test, to only enroll in
rkaplow
2016/11/10 22:56:46
makes sense, field trial group should only be trig
noyau (Ping after 24h)
2016/11/14 17:08:08
Ok, I'll make sure everyone is aware.
Marc Treib
2016/11/16 12:50:29
Drive-by: This is subtle and not obvious from read
noyau (Ping after 24h)
2016/11/16 13:06:03
Done.
|
popular_sites_->StartFetch( |
false, base::Bind(&MostVisitedSites::OnPopularSitesAvailable, |
base::Unretained(this))); |