Commit abe2d76d authored by Charles Harrison's avatar Charles Harrison Committed by Commit Bot

[tab-under] Remove RAPPOR logging since UKM makes it a bit obsolete

Bug: None
Change-Id: Ie31654577b2270f83380b06f753bb48f2740a289
Reviewed-on: https://chromium-review.googlesource.com/943344Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Commit-Queue: Charlie Harrison <csharrison@chromium.org>
Cr-Commit-Position: refs/heads/master@{#540336}
parent bf8b140e
...@@ -25,8 +25,6 @@ ...@@ -25,8 +25,6 @@
#include "chrome/test/base/chrome_render_view_host_test_harness.h" #include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h" #include "chrome/test/base/testing_profile.h"
#include "components/rappor/public/rappor_parameters.h"
#include "components/rappor/test_rappor_service.h"
#include "components/ukm/content/source_url_recorder.h" #include "components/ukm/content/source_url_recorder.h"
#include "components/ukm/test_ukm_recorder.h" #include "components/ukm/test_ukm_recorder.h"
#include "components/ukm/ukm_source.h" #include "components/ukm/ukm_source.h"
...@@ -605,14 +603,11 @@ TEST_P(BlockTabUnderIncognitoTest, DisableFeature_LogsDidTabUnder) { ...@@ -605,14 +603,11 @@ TEST_P(BlockTabUnderIncognitoTest, DisableFeature_LogsDidTabUnder) {
histogram_tester()->ExpectTotalCount(GetActionHistogram(), 3); histogram_tester()->ExpectTotalCount(GetActionHistogram(), 3);
} }
TEST_F(BlockTabUnderTest, LogsRapporAndUkm) { TEST_F(BlockTabUnderTest, LogsUkm) {
using UkmEntry = ukm::builders::AbusiveExperienceHeuristic; using UkmEntry = ukm::builders::AbusiveExperienceHeuristic;
ukm::InitializeSourceUrlRecorderForWebContents(web_contents()); ukm::InitializeSourceUrlRecorderForWebContents(web_contents());
ukm::TestAutoSetUkmRecorder test_ukm_recorder; ukm::TestAutoSetUkmRecorder test_ukm_recorder;
rappor::TestRapporServiceImpl test_rappor_service;
TestingBrowserProcess::GetGlobal()->SetRapporServiceImpl(
&test_rappor_service);
const GURL first_url("https://first.test/"); const GURL first_url("https://first.test/");
EXPECT_TRUE(NavigateAndCommitWithoutGesture(first_url)); EXPECT_TRUE(NavigateAndCommitWithoutGesture(first_url));
...@@ -621,13 +616,6 @@ TEST_F(BlockTabUnderTest, LogsRapporAndUkm) { ...@@ -621,13 +616,6 @@ TEST_F(BlockTabUnderTest, LogsRapporAndUkm) {
const GURL blocked_url("https://example.test/"); const GURL blocked_url("https://example.test/");
EXPECT_FALSE(NavigateAndCommitWithoutGesture(blocked_url)); EXPECT_FALSE(NavigateAndCommitWithoutGesture(blocked_url));
std::string sample;
rappor::RapporType type;
EXPECT_TRUE(test_rappor_service.GetRecordedSampleForMetric(
"Tab.TabUnder.Opener", &sample, &type));
EXPECT_EQ(first_url.host(), sample);
EXPECT_EQ(rappor::UMA_RAPPOR_TYPE, type);
auto entries = test_ukm_recorder.GetEntriesByName(UkmEntry::kEntryName); auto entries = test_ukm_recorder.GetEntriesByName(UkmEntry::kEntryName);
EXPECT_EQ(1u, entries.size()); EXPECT_EQ(1u, entries.size());
for (const auto* const entry : entries) { for (const auto* const entry : entries) {
......
...@@ -18,9 +18,6 @@ ...@@ -18,9 +18,6 @@
#include "chrome/browser/content_settings/tab_specific_content_settings.h" #include "chrome/browser/content_settings/tab_specific_content_settings.h"
#include "chrome/browser/ui/blocked_content/list_item_position.h" #include "chrome/browser/ui/blocked_content/list_item_position.h"
#include "chrome/browser/ui/blocked_content/popup_opener_tab_helper.h" #include "chrome/browser/ui/blocked_content/popup_opener_tab_helper.h"
#include "components/rappor/public/rappor_parameters.h"
#include "components/rappor/public/rappor_utils.h"
#include "components/rappor/rappor_service_impl.h"
#include "content/public/browser/browser_context.h" #include "content/public/browser/browser_context.h"
#include "content/public/browser/navigation_handle.h" #include "content/public/browser/navigation_handle.h"
#include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_frame_host.h"
...@@ -86,15 +83,6 @@ void LogTabUnderAttempt(content::NavigationHandle* handle, ...@@ -86,15 +83,6 @@ void LogTabUnderAttempt(content::NavigationHandle* handle,
bool off_the_record) { bool off_the_record) {
LogAction(TabUnderNavigationThrottle::Action::kDidTabUnder, off_the_record); LogAction(TabUnderNavigationThrottle::Action::kDidTabUnder, off_the_record);
// Log RAPPOR / UKM based on the opener URL, not the URL navigated to.
const GURL& opener_url = handle->GetWebContents()->GetLastCommittedURL();
if (rappor::RapporService* rappor_service =
g_browser_process->rappor_service()) {
rappor_service->RecordSampleString(
"Tab.TabUnder.Opener", rappor::UMA_RAPPOR_TYPE,
rappor::GetDomainAndRegistrySampleFromGURL(opener_url));
}
// The source id should generally be set, except for very rare circumstances // The source id should generally be set, except for very rare circumstances
// where the popup opener tab helper is not observing at the time the // where the popup opener tab helper is not observing at the time the
// previous navigation commit. // previous navigation commit.
......
...@@ -2434,6 +2434,9 @@ now we are only interested in H264, VP8 and VP9. ...@@ -2434,6 +2434,9 @@ now we are only interested in H264, VP8 and VP9.
</rappor-metric> </rappor-metric>
<rappor-metric name="Tab.TabUnder.Opener" type="UMA_RAPPOR_TYPE"> <rappor-metric name="Tab.TabUnder.Opener" type="UMA_RAPPOR_TYPE">
<obsolete>
Now logged in UKM (see AbusiveExperienceHeuristic)
</obsolete>
<owner>csharrison@chromium.org</owner> <owner>csharrison@chromium.org</owner>
<summary> <summary>
The domain and registry of the URL that attempted to initiate a The domain and registry of the URL that attempted to initiate a
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment