From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 20 Feb 2019 21:41:26 +0100
Subject: Disable metrics collection for NTP tiles

---
 .../android/ntp/most_visited_sites_bridge.cc        | 21 ---------------------
 components/ntp_tiles/BUILD.gn                       |  3 ---
 2 files changed, 24 deletions(-)

diff --git a/chrome/browser/android/ntp/most_visited_sites_bridge.cc b/chrome/browser/android/ntp/most_visited_sites_bridge.cc
--- a/chrome/browser/android/ntp/most_visited_sites_bridge.cc
+++ b/chrome/browser/android/ntp/most_visited_sites_bridge.cc
@@ -23,7 +23,6 @@
 #include "chrome/browser/profiles/profile_android.h"
 #include "components/favicon_base/favicon_types.h"
 #include "components/history/core/browser/history_service.h"
-#include "components/ntp_tiles/metrics.h"
 #include "components/ntp_tiles/most_visited_sites.h"
 #include "components/ntp_tiles/section_type.h"
 #include "components/rappor/rappor_service_impl.h"
@@ -45,7 +44,6 @@ using ntp_tiles::NTPTilesVector;
 using ntp_tiles::SectionType;
 using ntp_tiles::TileTitleSource;
 using ntp_tiles::TileSource;
-using ntp_tiles::TileVisualType;
 
 namespace {
 
@@ -240,7 +238,6 @@ void MostVisitedSitesBridge::RecordPageImpression(
     JNIEnv* env,
     const JavaParamRef<jobject>& obj,
     jint jtiles_count) {
-  ntp_tiles::metrics::RecordPageImpression(jtiles_count);
 }
 
 void MostVisitedSitesBridge::RecordTileImpression(
@@ -253,18 +250,6 @@ void MostVisitedSitesBridge::RecordTileImpression(
     jint jsource,
     jlong jdata_generation_time_ms,
     const JavaParamRef<jstring>& jurl) {
-  GURL url(ConvertJavaStringToUTF8(env, jurl));
-  TileTitleSource title_source = static_cast<TileTitleSource>(jtitle_source);
-  TileSource source = static_cast<TileSource>(jsource);
-  TileVisualType visual_type = static_cast<TileVisualType>(jvisual_type);
-  favicon_base::IconType icon_type =
-      static_cast<favicon_base::IconType>(jicon_type);
-
-  ntp_tiles::metrics::RecordTileImpression(
-      ntp_tiles::NTPTileImpression(
-          jindex, source, title_source, visual_type, icon_type,
-          base::Time::FromJavaTime(jdata_generation_time_ms), url),
-      g_browser_process->rappor_service());
 }
 
 void MostVisitedSitesBridge::RecordOpenedMostVisitedItem(
@@ -275,12 +260,6 @@ void MostVisitedSitesBridge::RecordOpenedMostVisitedItem(
     jint title_source,
     jint source,
     jlong jdata_generation_time_ms) {
-  ntp_tiles::metrics::RecordTileClick(ntp_tiles::NTPTileImpression(
-      index, static_cast<TileSource>(source),
-      static_cast<TileTitleSource>(title_source),
-      static_cast<TileVisualType>(tile_type), favicon_base::IconType::kInvalid,
-      base::Time::FromJavaTime(jdata_generation_time_ms),
-      /*url_for_rappor=*/GURL()));
 }
 
 static jlong JNI_MostVisitedSitesBridge_Init(
diff --git a/components/ntp_tiles/BUILD.gn b/components/ntp_tiles/BUILD.gn
--- a/components/ntp_tiles/BUILD.gn
+++ b/components/ntp_tiles/BUILD.gn
@@ -20,8 +20,6 @@ static_library("ntp_tiles") {
     "icon_cacher.h",
     "icon_cacher_impl.cc",
     "icon_cacher_impl.h",
-    "metrics.cc",
-    "metrics.h",
     "most_visited_sites.cc",
     "most_visited_sites.h",
     "ntp_tile.cc",
@@ -91,7 +89,6 @@ source_set("unit_tests") {
     "custom_links_manager_impl_unittest.cc",
     "custom_links_store_unittest.cc",
     "icon_cacher_impl_unittest.cc",
-    "metrics_unittest.cc",
     "most_visited_sites_unittest.cc",
     "popular_sites_impl_unittest.cc",
   ]
-- 
2.11.0

