Commit a5194c70 authored by Paul Dyson's avatar Paul Dyson Committed by Commit Bot

Move app_source_url_recorder to /components/ukm.

AppSourceUrlRecorder does not belong in components/ukm/content/ and
would be better placed in /components/ukm. This will allow
AppSourceUrlRecorder to be called from ash.

Bug: 899123
Change-Id: I26838e3de938740743a00316ba71ad9afc6d9466
Reviewed-on: https://chromium-review.googlesource.com/c/1300817Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Reviewed-by: default avatarKen Rockot <rockot@google.com>
Commit-Queue: Paul Dyson <pdyson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605485}
parent 27053f58
...@@ -9,6 +9,8 @@ import("//testing/test.gni") ...@@ -9,6 +9,8 @@ import("//testing/test.gni")
# URLs for top-level navigations. # URLs for top-level navigations.
static_library("ukm") { static_library("ukm") {
sources = [ sources = [
"app_source_url_recorder.cc",
"app_source_url_recorder.h",
"persisted_logs_metrics_impl.cc", "persisted_logs_metrics_impl.cc",
"persisted_logs_metrics_impl.h", "persisted_logs_metrics_impl.h",
"ukm_pref_names.cc", "ukm_pref_names.cc",
...@@ -32,6 +34,7 @@ static_library("ukm") { ...@@ -32,6 +34,7 @@ static_library("ukm") {
deps = [ deps = [
"//base", "//base",
"//components/crx_file",
"//components/data_use_measurement/core", "//components/data_use_measurement/core",
"//components/metrics", "//components/metrics",
"//components/prefs", "//components/prefs",
...@@ -82,6 +85,7 @@ static_library("test_support") { ...@@ -82,6 +85,7 @@ static_library("test_support") {
source_set("unit_tests") { source_set("unit_tests") {
testonly = true testonly = true
sources = [ sources = [
"app_source_url_recorder_test.cc",
"observers/sync_disable_observer_unittest.cc", "observers/sync_disable_observer_unittest.cc",
"ukm_service_unittest.cc", "ukm_service_unittest.cc",
] ]
......
include_rules = [ include_rules = [
"+components/crx_file",
"+components/metrics", "+components/metrics",
"+components/prefs", "+components/prefs",
"+components/unified_consent", "+components/unified_consent",
...@@ -13,4 +14,4 @@ specific_include_rules = { ...@@ -13,4 +14,4 @@ specific_include_rules = {
".*unittest\.cc": [ ".*unittest\.cc": [
"+components/sync_preferences/testing_pref_service_syncable.h", "+components/sync_preferences/testing_pref_service_syncable.h",
] ]
} }
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "components/ukm/content/app_source_url_recorder.h" #include "components/ukm/app_source_url_recorder.h"
#include "base/atomic_sequence_num.h" #include "base/atomic_sequence_num.h"
#include "components/crx_file/id_util.h" #include "components/crx_file/id_util.h"
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef COMPONENTS_UKM_CONTENT_APP_SOURCE_URL_RECORDER_H_ #ifndef COMPONENTS_UKM_APP_SOURCE_URL_RECORDER_H_
#define COMPONENTS_UKM_CONTENT_APP_SOURCE_URL_RECORDER_H_ #define COMPONENTS_UKM_APP_SOURCE_URL_RECORDER_H_
#include "services/metrics/public/cpp/ukm_source_id.h" #include "services/metrics/public/cpp/ukm_source_id.h"
...@@ -37,4 +37,4 @@ class AppSourceUrlRecorder { ...@@ -37,4 +37,4 @@ class AppSourceUrlRecorder {
} // namespace ukm } // namespace ukm
#endif // COMPONENTS_UKM_CONTENT_APP_SOURCE_URL_RECORDER_H_ #endif // COMPONENTS_UKM_APP_SOURCE_URL_RECORDER_H_
...@@ -2,22 +2,21 @@ ...@@ -2,22 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "components/ukm/content/app_source_url_recorder.h" #include "components/ukm/app_source_url_recorder.h"
#include "base/test/scoped_feature_list.h" #include "base/test/scoped_feature_list.h"
#include "base/test/scoped_task_environment.h"
#include "components/ukm/test_ukm_recorder.h" #include "components/ukm/test_ukm_recorder.h"
#include "content/public/test/test_renderer_host.h"
#include "services/metrics/public/cpp/ukm_source.h" #include "services/metrics/public/cpp/ukm_source.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h" #include "url/gurl.h"
namespace ukm { namespace ukm {
class AppSourceUrlRecorderTest : public content::RenderViewHostTestHarness { class AppSourceUrlRecorderTest : public testing::Test {
public: public:
void SetUp() override { void SetUp() override {
scoped_feature_list_.InitAndEnableFeature(kUkmAppLogging); scoped_feature_list_.InitAndEnableFeature(kUkmAppLogging);
content::RenderViewHostTestHarness::SetUp();
} }
protected: protected:
...@@ -30,6 +29,7 @@ class AppSourceUrlRecorderTest : public content::RenderViewHostTestHarness { ...@@ -30,6 +29,7 @@ class AppSourceUrlRecorderTest : public content::RenderViewHostTestHarness {
} }
base::test::ScopedFeatureList scoped_feature_list_; base::test::ScopedFeatureList scoped_feature_list_;
base::test::ScopedTaskEnvironment scoped_task_environment_;
TestAutoSetUkmRecorder test_ukm_recorder_; TestAutoSetUkmRecorder test_ukm_recorder_;
}; };
......
...@@ -4,14 +4,11 @@ ...@@ -4,14 +4,11 @@
static_library("content") { static_library("content") {
sources = [ sources = [
"app_source_url_recorder.cc",
"app_source_url_recorder.h",
"source_url_recorder.cc", "source_url_recorder.cc",
"source_url_recorder.h", "source_url_recorder.h",
] ]
deps = [ deps = [
"//base", "//base",
"//components/crx_file",
"//content/public/browser", "//content/public/browser",
"//services/metrics/public/cpp:metrics_cpp", "//services/metrics/public/cpp:metrics_cpp",
"//services/metrics/public/cpp:ukm_builders", "//services/metrics/public/cpp:ukm_builders",
...@@ -23,7 +20,6 @@ static_library("content") { ...@@ -23,7 +20,6 @@ static_library("content") {
source_set("unit_tests") { source_set("unit_tests") {
testonly = true testonly = true
sources = [ sources = [
"app_source_url_recorder_test.cc",
"source_url_recorder_test.cc", "source_url_recorder_test.cc",
] ]
deps = [ deps = [
......
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