From ccce58f0a6411f4c8e4fdeeb3636495126c3efd8 Mon Sep 17 00:00:00 2001 From: Cepera Date: Wed, 9 Aug 2023 14:52:47 +0700 Subject: [PATCH] Option to disable autofill while in private browsing mode (#19585) --- app/brave_settings_strings.grdp | 8 ++ browser/brave_autofill_browsertest.cc | 88 +++++++++++++++++++ browser/brave_profile_prefs.cc | 3 +- .../api/settings_private/brave_prefs_util.cc | 4 + .../brave_pref_service_incognito_allowlist.cc | 3 +- .../settings/brave_overrides/autofill_page.ts | 23 +++++ .../settings/brave_overrides/index.ts | 1 + browser/resources/settings/sources.gni | 1 + browser/tor/BUILD.gn | 4 + browser/tor/brave_tor_browsertest.cc | 51 ++++++++++- ...ave_settings_localized_strings_provider.cc | 4 + .../chrome_password_manager_client.cc | 15 ++++ .../ui/autofill/chrome_autofill_client.cc | 51 +++++++++++ .../components/autofill/content/browser/DEPS | 3 + .../content_autofill_driver_factory.cc | 35 ++++++++ components/constants/pref_names.cc | 1 + components/constants/pref_names.h | 1 + test/BUILD.gn | 3 + 18 files changed, 296 insertions(+), 3 deletions(-) create mode 100644 browser/brave_autofill_browsertest.cc create mode 100644 browser/resources/settings/brave_overrides/autofill_page.ts create mode 100644 chromium_src/chrome/browser/password_manager/chrome_password_manager_client.cc create mode 100644 chromium_src/chrome/browser/ui/autofill/chrome_autofill_client.cc create mode 100644 chromium_src/components/autofill/content/browser/DEPS create mode 100644 chromium_src/components/autofill/content/browser/content_autofill_driver_factory.cc diff --git a/app/brave_settings_strings.grdp b/app/brave_settings_strings.grdp index 09a2658d6e6..6126c203bfa 100644 --- a/app/brave_settings_strings.grdp +++ b/app/brave_settings_strings.grdp @@ -150,6 +150,14 @@ + + + Allow auto-fill in private windows + + + Info from regular windows can be read/auto-filled in private windows + + New Tab Page diff --git a/browser/brave_autofill_browsertest.cc b/browser/brave_autofill_browsertest.cc new file mode 100644 index 00000000000..b05e26a59ff --- /dev/null +++ b/browser/brave_autofill_browsertest.cc @@ -0,0 +1,88 @@ +/* Copyright (c) 2023 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at https://mozilla.org/MPL/2.0/. */ + +#include "base/path_service.h" +#include "brave/components/constants/brave_paths.h" +#include "brave/components/constants/pref_names.h" +#include "chrome/browser/password_manager/chrome_password_manager_client.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/autofill/chrome_autofill_client.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/test/base/in_process_browser_test.h" +#include "chrome/test/base/ui_test_utils.h" +#include "components/autofill/content/browser/content_autofill_driver.h" +#include "components/autofill/content/browser/content_autofill_driver_factory.h" +#include "components/autofill/core/browser/browser_autofill_manager.h" +#include "content/public/browser/web_contents.h" +#include "content/public/test/browser_test.h" +#include "content/public/test/browser_test_utils.h" +#include "net/dns/mock_host_resolver.h" + +class BraveAutofillBrowserTest : public InProcessBrowserTest { + public: + void SetUpOnMainThread() override { + InProcessBrowserTest::SetUpOnMainThread(); + host_resolver()->AddRule("*", "127.0.0.1"); + + brave::RegisterPathProvider(); + base::FilePath test_data_dir; + base::PathService::Get(brave::DIR_TEST_DATA, &test_data_dir); + embedded_test_server()->ServeFilesFromDirectory(test_data_dir); + + ASSERT_TRUE(embedded_test_server()->Start()); + } + + content::WebContents* PrepareWebContents(Browser* browser, const GURL& url) { + TabStripModel* model = browser->tab_strip_model(); + auto* active_contents = model->GetActiveWebContents(); + EXPECT_TRUE(content::NavigateToURL(active_contents, url)); + EXPECT_TRUE(WaitForLoadStop(active_contents)); + EXPECT_EQ(url, active_contents->GetVisibleURL()); + return active_contents; + } + + void TestAutofillInWindow(Browser* browser, const GURL& url, bool enabled) { + auto* active_contents = PrepareWebContents(browser, url); + // Logins. + autofill::ChromeAutofillClient* autofill_client = + autofill::ChromeAutofillClient::FromWebContentsForTesting( + active_contents); + EXPECT_EQ(autofill_client->IsAutocompleteEnabled(), enabled); + // Passwords. + ChromePasswordManagerClient* client = + ChromePasswordManagerClient::FromWebContents(active_contents); + EXPECT_EQ(client->IsFillingEnabled(url), enabled); + // Other info. + autofill::ContentAutofillDriver* cross_driver = + autofill::ContentAutofillDriverFactory::FromWebContents(active_contents) + ->DriverForFrame(active_contents->GetPrimaryMainFrame()); + ASSERT_TRUE(cross_driver); + EXPECT_EQ(static_cast( + cross_driver->autofill_manager()) + ->IsAutofillEnabled(), + enabled); + } +}; + +IN_PROC_BROWSER_TEST_F(BraveAutofillBrowserTest, + AutofillIsNotAllowedInPrivateWindows) { + GURL url( + embedded_test_server()->GetURL("example.com", "/brave_scheme_load.html")); + + // Disable autofill in private windows. + browser()->profile()->GetPrefs()->SetBoolean(kBraveAutofillPrivateWindows, + false); + TestAutofillInWindow(browser(), url, true); + Browser* private_browser = CreateIncognitoBrowser(nullptr); + TestAutofillInWindow(private_browser, url, false); + + // Enable autofill in private windows. + browser()->profile()->GetPrefs()->SetBoolean(kBraveAutofillPrivateWindows, + true); + TestAutofillInWindow(browser(), url, true); + TestAutofillInWindow(private_browser, url, true); + + CloseBrowserSynchronously(private_browser); +} diff --git a/browser/brave_profile_prefs.cc b/browser/brave_profile_prefs.cc index 29b137e8ff8..433dac00322 100644 --- a/browser/brave_profile_prefs.cc +++ b/browser/brave_profile_prefs.cc @@ -210,7 +210,8 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { brave_perf_predictor::PerfPredictorTabHelper::RegisterProfilePrefs(registry); brave_perf_predictor::P3ABandwidthSavingsTracker::RegisterProfilePrefs( registry); - + // autofill + registry->RegisterBooleanPref(kBraveAutofillPrivateWindows, true); // appearance registry->RegisterBooleanPref(kShowBookmarksButton, true); registry->RegisterBooleanPref(kShowSidePanelButton, true); diff --git a/browser/extensions/api/settings_private/brave_prefs_util.cc b/browser/extensions/api/settings_private/brave_prefs_util.cc index ae312a51ac8..6d9a777bcd7 100644 --- a/browser/extensions/api/settings_private/brave_prefs_util.cc +++ b/browser/extensions/api/settings_private/brave_prefs_util.cc @@ -132,6 +132,10 @@ const PrefsUtil::TypedPrefMap& BravePrefsUtil::GetAllowlistedKeys() { (*s_brave_allowlist)[prefs::kSyncedDefaultPrivateSearchProviderGUID] = settings_api::PrefType::PREF_TYPE_NUMBER; + // autofill prefs + (*s_brave_allowlist)[kBraveAutofillPrivateWindows] = + settings_api::PrefType::PREF_TYPE_BOOLEAN; + // appearance prefs (*s_brave_allowlist)[kShowBookmarksButton] = settings_api::PrefType::PREF_TYPE_BOOLEAN; diff --git a/browser/prefs/brave_pref_service_incognito_allowlist.cc b/browser/prefs/brave_pref_service_incognito_allowlist.cc index e225582f985..7f778932860 100644 --- a/browser/prefs/brave_pref_service_incognito_allowlist.cc +++ b/browser/prefs/brave_pref_service_incognito_allowlist.cc @@ -27,8 +27,9 @@ namespace brave { const std::vector& GetBravePersistentPrefNames() { static base::NoDestructor> brave_allowlist({ + kBraveAutofillPrivateWindows, #if !BUILDFLAG(IS_ANDROID) - prefs::kSidePanelHorizontalAlignment, kTabMuteIndicatorNotClickable, + prefs::kSidePanelHorizontalAlignment, kTabMuteIndicatorNotClickable, brave_tabs::kVerticalTabsExpandedWidth, brave_tabs::kVerticalTabsEnabled, brave_tabs::kVerticalTabsCollapsed, brave_tabs::kVerticalTabsFloatingEnabled, diff --git a/browser/resources/settings/brave_overrides/autofill_page.ts b/browser/resources/settings/brave_overrides/autofill_page.ts new file mode 100644 index 00000000000..2689ac17e92 --- /dev/null +++ b/browser/resources/settings/brave_overrides/autofill_page.ts @@ -0,0 +1,23 @@ +// Copyright (c) 2023 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// You can obtain one at https://mozilla.org/MPL/2.0/. + +import {html, RegisterPolymerTemplateModifications} from 'chrome://resources/brave/polymer_overriding.js' + +import {loadTimeData} from '../i18n_setup.js' + +RegisterPolymerTemplateModifications({ + 'settings-autofill-page': (templateContent) => { + templateContent.appendChild(html` + + `) + } + }, +) diff --git a/browser/resources/settings/brave_overrides/index.ts b/browser/resources/settings/brave_overrides/index.ts index 0de5e7a3717..34be36a758a 100644 --- a/browser/resources/settings/brave_overrides/index.ts +++ b/browser/resources/settings/brave_overrides/index.ts @@ -12,6 +12,7 @@ import './config.js' import { ContentSettingsTypes } from '../site_settings/constants.js' import './about_page.js' +import './autofill_page.js' import './appearance_page.js' import './basic_page.js' import './clear_browsing_data_dialog.js' diff --git a/browser/resources/settings/sources.gni b/browser/resources/settings/sources.gni index 03c79d4e9f3..50e048c7730 100644 --- a/browser/resources/settings/sources.gni +++ b/browser/resources/settings/sources.gni @@ -68,6 +68,7 @@ brave_settings_non_web_component_files = [ "brave_new_tab_page/brave_new_tab_browser_proxy.ts", "brave_leo_assistant_page/brave_leo_assistant_browser_proxy.ts", "brave_overrides/about_page.ts", + "brave_overrides/autofill_page.ts", "brave_overrides/appearance_page.ts", "brave_overrides/basic_page.ts", "brave_overrides/clear_browsing_data_dialog.ts", diff --git a/browser/tor/BUILD.gn b/browser/tor/BUILD.gn index ac7aa6510b1..fc7d0f44c83 100644 --- a/browser/tor/BUILD.gn +++ b/browser/tor/BUILD.gn @@ -38,11 +38,15 @@ source_set("tor") { "//brave/components/tor", "//brave/components/tor:pref_names", "//chrome/common", + "//components/autofill/content/browser", + "//components/autofill/core/browser", "//components/keyed_service/content", "//components/safe_browsing/core/common:safe_browsing_prefs", "//components/translate/core/browser", "//content/public/browser", + "//net", "//third_party/blink/public/common", + "//url", ] # Below dep list are not directly used tor target. diff --git a/browser/tor/brave_tor_browsertest.cc b/browser/tor/brave_tor_browsertest.cc index 9772ee3967f..b26c489d9e6 100644 --- a/browser/tor/brave_tor_browsertest.cc +++ b/browser/tor/brave_tor_browsertest.cc @@ -25,6 +25,7 @@ #include "brave/components/brave_component_updater/browser/brave_component.h" #include "brave/components/brave_shields/browser/brave_shields_util.h" #include "brave/components/constants/brave_paths.h" +#include "brave/components/constants/pref_names.h" #include "brave/components/tor/brave_tor_client_updater.h" #include "brave/components/tor/brave_tor_pluggable_transport_updater.h" #include "brave/components/tor/tor_launcher_factory.h" @@ -33,8 +34,10 @@ #include "brave/components/tor/tor_utils.h" #include "build/build_config.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" +#include "chrome/browser/password_manager/chrome_password_manager_client.h" #include "chrome/browser/prefs/incognito_mode_prefs.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/autofill/chrome_autofill_client.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/common/chrome_paths.h" @@ -42,6 +45,9 @@ #include "chrome/common/pref_names.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" +#include "components/autofill/content/browser/content_autofill_driver.h" +#include "components/autofill/content/browser/content_autofill_driver_factory.h" +#include "components/autofill/core/browser/browser_autofill_manager.h" #include "components/policy/core/common/policy_pref_names.h" #include "components/prefs/pref_service.h" #include "content/public/browser/ssl_host_state_delegate.h" @@ -53,6 +59,29 @@ namespace { +void TestAutofillInWindow(content::WebContents* active_contents, + const GURL& fake_url, + bool enabled) { + // Logins. + autofill::ChromeAutofillClient* autofill_client = + autofill::ChromeAutofillClient::FromWebContentsForTesting( + active_contents); + EXPECT_EQ(autofill_client->IsAutocompleteEnabled(), enabled); + // Passwords. + ChromePasswordManagerClient* client = + ChromePasswordManagerClient::FromWebContents(active_contents); + EXPECT_EQ(client->IsFillingEnabled(fake_url), enabled); + // Other info. + autofill::ContentAutofillDriver* cross_driver = + autofill::ContentAutofillDriverFactory::FromWebContents(active_contents) + ->DriverForFrame(active_contents->GetPrimaryMainFrame()); + ASSERT_TRUE(cross_driver); + EXPECT_EQ(static_cast( + cross_driver->autofill_manager()) + ->IsAutofillEnabled(), + enabled); +} + struct MockTorLauncherObserver : public TorLauncherObserver { public: MOCK_METHOD(void, OnTorLauncherCrashed, (), (override)); @@ -246,7 +275,6 @@ class BraveTorTestWithCustomProfile : public BraveTorTest { private: void SetUpCommandLine(base::CommandLine* command_line) override { InProcessBrowserTest::SetUpCommandLine(command_line); - if (GetTestPreCount() > 0) { base::ScopedAllowBlockingForTesting allow_blocking; @@ -394,6 +422,27 @@ IN_PROC_BROWSER_TEST_F(BraveTorTestWithCustomProfile, Incognito) { EXPECT_TRUE(is_element_enabled("torSnowflake")); } +IN_PROC_BROWSER_TEST_F(BraveTorTestWithCustomProfile, Autofill) { + GURL fake_url("http://brave.com/"); + // Disable autofill in private windows. + browser()->profile()->GetPrefs()->SetBoolean(kBraveAutofillPrivateWindows, + false); + auto* tor_profile = OpenTorWindow(); + EXPECT_NE(nullptr, tor_profile); + EXPECT_TRUE(tor_profile->IsTor()); + Browser* tor_browser = chrome::FindBrowserWithProfile(tor_profile); + content::WebContents* web_contents = + tor_browser->tab_strip_model()->GetActiveWebContents(); + TestAutofillInWindow(web_contents, fake_url, false); + + // Enable autofill in private windows. + browser()->profile()->GetPrefs()->SetBoolean(kBraveAutofillPrivateWindows, + true); + web_contents->GetController().Reload(content::ReloadType::NORMAL, true); + EXPECT_TRUE(content::WaitForLoadStop(web_contents)); + TestAutofillInWindow(web_contents, fake_url, true); +} + IN_PROC_BROWSER_TEST_F(BraveTorTest, PRE_ResetBridges) { EXPECT_FALSE(TorProfileServiceFactory::IsTorDisabled(browser()->profile())); DownloadTorClient(); diff --git a/browser/ui/webui/settings/brave_settings_localized_strings_provider.cc b/browser/ui/webui/settings/brave_settings_localized_strings_provider.cc index 765933e1529..b3b6a4a9584 100644 --- a/browser/ui/webui/settings/brave_settings_localized_strings_provider.cc +++ b/browser/ui/webui/settings/brave_settings_localized_strings_provider.cc @@ -193,6 +193,10 @@ void BraveAddCommonStrings(content::WebUIDataSource* html_source, {"braveWebDiscoveryLabel", IDS_SETTINGS_WEB_DISCOVERY_LABEL}, {"braveWebDiscoverySubLabel", IDS_SETTINGS_WEB_DISCOVERY_SUBLABEL}, #endif + {"autofillInPrivateSettingLabel", + IDS_SETTINGS_BRAVE_AUTOFILL_PRIVATE_WINDOWS_LABEL}, + {"autofillInPrivateSettingDesc", + IDS_SETTINGS_BRAVE_AUTOFILL_PRIVATE_WINDOWS_DESC}, {"mruCyclingSettingLabel", IDS_SETTINGS_BRAVE_MRU_CYCLING_LABEL}, {"speedreaderSettingLabel", IDS_SETTINGS_SPEEDREADER_LABEL}, {"speedreaderSettingSubLabel", IDS_SETTINGS_SPEEDREADER_SUB_LABEL}, diff --git a/chromium_src/chrome/browser/password_manager/chrome_password_manager_client.cc b/chromium_src/chrome/browser/password_manager/chrome_password_manager_client.cc new file mode 100644 index 00000000000..1e876c112e8 --- /dev/null +++ b/chromium_src/chrome/browser/password_manager/chrome_password_manager_client.cc @@ -0,0 +1,15 @@ +/* Copyright (c) 2023 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at https://mozilla.org/MPL/2.0/. */ + +#include "brave/components/constants/pref_names.h" +#include "chrome/browser/profiles/profile.h" + +#define IsGuestSession \ + IsGuestSession() || \ + (!profile->GetPrefs()->GetBoolean(kBraveAutofillPrivateWindows) && \ + (IsOffTheRecord() || profile->IsTor())) || \ + profile->IsGuestSession +#include "src/chrome/browser/password_manager/chrome_password_manager_client.cc" +#undef IsGuestSession diff --git a/chromium_src/chrome/browser/ui/autofill/chrome_autofill_client.cc b/chromium_src/chrome/browser/ui/autofill/chrome_autofill_client.cc new file mode 100644 index 00000000000..7fd4caf3d60 --- /dev/null +++ b/chromium_src/chrome/browser/ui/autofill/chrome_autofill_client.cc @@ -0,0 +1,51 @@ +// Copyright (c) 2023 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// You can obtain one at https://mozilla.org/MPL/2.0/. + +#include "chrome/browser/ui/autofill/chrome_autofill_client.h" +#include "base/memory/ptr_util.h" +#include "brave/components/constants/pref_names.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/autofill/payments/webauthn_dialog_controller_impl.h" +#include "chrome/browser/ui/page_info/page_info_dialog.h" + +namespace autofill { + +namespace { +bool IsPrivateProfile(content::WebContents* web_contents) { + if (!web_contents) { + return false; + } + auto* profile = + Profile::FromBrowserContext(web_contents->GetBrowserContext()); + if (!profile) { + return false; + } + return (profile_metrics::GetBrowserProfileType(profile) == + profile_metrics::BrowserProfileType::kIncognito) || + profile->IsTor(); +} + +} // namespace + +class BraveChromeAutofillClient : public ChromeAutofillClient { + public: + using ChromeAutofillClient::ChromeAutofillClient; + + bool IsAutocompleteEnabled() const override { + auto enabled = ChromeAutofillClient::IsAutocompleteEnabled(); + if (!IsPrivateProfile(web_contents())) { + return enabled; + } + enabled = enabled && GetPrefs()->GetBoolean(kBraveAutofillPrivateWindows); + return enabled; + } +}; + +} // namespace autofill + +#define WrapUnique WrapUnique(new autofill::BraveChromeAutofillClient(web_contents))); \ + if (0) std::unique_ptr dummy( +#include "src/chrome/browser/ui/autofill/chrome_autofill_client.cc" +#undef WrapUnique diff --git a/chromium_src/components/autofill/content/browser/DEPS b/chromium_src/components/autofill/content/browser/DEPS new file mode 100644 index 00000000000..74d5d7ed71f --- /dev/null +++ b/chromium_src/components/autofill/content/browser/DEPS @@ -0,0 +1,3 @@ +include_rules = [ + "+brave/components/constants", +] diff --git a/chromium_src/components/autofill/content/browser/content_autofill_driver_factory.cc b/chromium_src/components/autofill/content/browser/content_autofill_driver_factory.cc new file mode 100644 index 00000000000..a0fee47bdef --- /dev/null +++ b/chromium_src/components/autofill/content/browser/content_autofill_driver_factory.cc @@ -0,0 +1,35 @@ +// Copyright (c) 2023 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// You can obtain one at https://mozilla.org/MPL/2.0/. + +#include "components/autofill/content/browser/content_autofill_driver_factory.h" + +#include "brave/components/constants/pref_names.h" +#include "components/autofill/core/browser/browser_autofill_manager.h" + +namespace autofill { + +class BraveBrowserAutofillManager : public BrowserAutofillManager { + public: + using BrowserAutofillManager::BrowserAutofillManager; + + bool IsAutofillEnabled() const override { + auto enabled = BrowserAutofillManager::IsAutofillEnabled(); + if (client()->GetProfileType() != + profile_metrics::BrowserProfileType::kIncognito && + client()->GetProfileType() != + profile_metrics::BrowserProfileType::kOtherOffTheRecordProfile) { + return enabled; + } + enabled = enabled && + client()->GetPrefs()->GetBoolean(kBraveAutofillPrivateWindows); + return enabled; + } +}; + +} // namespace autofill + +#define BrowserAutofillManager BraveBrowserAutofillManager +#include "src/components/autofill/content/browser/content_autofill_driver_factory.cc" +#undef BrowserAutofillManager diff --git a/components/constants/pref_names.cc b/components/constants/pref_names.cc index b729a6c935c..4f1c3243fac 100644 --- a/components/constants/pref_names.cc +++ b/components/constants/pref_names.cc @@ -5,6 +5,7 @@ #include "brave/components/constants/pref_names.h" +const char kBraveAutofillPrivateWindows[] = "brave.autofill_private_windows"; const char kManagedBraveShieldsDisabledForUrls[] = "brave.managed_shields_disabled"; const char kManagedBraveShieldsEnabledForUrls[] = diff --git a/components/constants/pref_names.h b/components/constants/pref_names.h index 578e82a2dfe..cdb3a5a9702 100644 --- a/components/constants/pref_names.h +++ b/components/constants/pref_names.h @@ -8,6 +8,7 @@ #include "build/build_config.h" +extern const char kBraveAutofillPrivateWindows[]; extern const char kManagedBraveShieldsEnabledForUrls[]; extern const char kManagedBraveShieldsDisabledForUrls[]; extern const char kAdsBlocked[]; diff --git a/test/BUILD.gn b/test/BUILD.gn index faaf71cd8d1..28cac1c3d59 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -1107,6 +1107,7 @@ test("brave_browser_tests") { if (!is_android) { sources += [ + "//brave/browser/brave_autofill_browsertest.cc", "//brave/browser/brave_resources_browsertest.cc", "//brave/browser/misc_metrics/vertical_tab_metrics_browsertest.cc", "//brave/browser/ssl/certificate_transparency_browsertest.cc", @@ -1119,6 +1120,8 @@ test("brave_browser_tests") { "//brave/browser/ui/whats_new:browser_test", "//chrome/browser/apps/app_service:app_service", "//chrome/browser/apps/app_service:constants", + "//components/autofill/content/browser", + "//components/autofill/core/browser", ] }