Skip to content

Commit

Permalink
Cleanup: Remove unused SyncService dependency from Ash PeopleSection
Browse files Browse the repository at this point in the history
This bubbles up through several layers, which all don't need the
SyncService anymore.

Fixed: 1274802
Change-Id: Ie7e6bb0c5012ebca8649f85e0e5ffc3adb85762f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4614569
Auto-Submit: Marc Treib <treib@chromium.org>
Reviewed-by: Boris Sazonov <bsazonov@chromium.org>
Commit-Queue: Boris Sazonov <bsazonov@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1158731}
  • Loading branch information
Marc Treib authored and Chromium LUCI CQ committed Jun 16, 2023
1 parent ebd57a5 commit 267d5a5
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 32 deletions.
2 changes: 0 additions & 2 deletions chrome/browser/ui/webui/settings/ash/os_settings_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ OsSettingsManager::OsSettingsManager(
local_search_service::LocalSearchServiceProxy* local_search_service_proxy,
multidevice_setup::MultiDeviceSetupClient* multidevice_setup_client,
phonehub::PhoneHubManager* phone_hub_manager,
syncer::SyncService* sync_service,
KerberosCredentialsManager* kerberos_credentials_manager,
ArcAppListPrefs* arc_app_list_prefs,
signin::IdentityManager* identity_manager,
Expand All @@ -39,7 +38,6 @@ OsSettingsManager::OsSettingsManager(
search_tag_registry_.get(),
multidevice_setup_client,
phone_hub_manager,
sync_service,
kerberos_credentials_manager,
arc_app_list_prefs,
identity_manager,
Expand Down
5 changes: 0 additions & 5 deletions chrome/browser/ui/webui/settings/ash/os_settings_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ namespace signin {
class IdentityManager;
} // namespace signin

namespace syncer {
class SyncService;
} // namespace syncer

namespace ash {

class CupsPrintersManager;
Expand Down Expand Up @@ -92,7 +88,6 @@ class OsSettingsManager : public KeyedService {
local_search_service::LocalSearchServiceProxy* local_search_service_proxy,
multidevice_setup::MultiDeviceSetupClient* multidevice_setup_client,
phonehub::PhoneHubManager* phone_hub_manager,
syncer::SyncService* sync_service,
KerberosCredentialsManager* kerberos_credentials_manager,
ArcAppListPrefs* arc_app_list_prefs,
signin::IdentityManager* identity_manager,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "chrome/browser/ash/printing/cups_printers_manager_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/sync/sync_service_factory.h"
#include "chrome/browser/ui/webui/settings/ash/os_settings_manager.h"
#include "chromeos/ash/components/local_search_service/public/cpp/local_search_service_proxy_factory.h"

Expand Down Expand Up @@ -47,7 +46,6 @@ OsSettingsManagerFactory::OsSettingsManagerFactory()
local_search_service::LocalSearchServiceProxyFactory::GetInstance());
DependsOn(multidevice_setup::MultiDeviceSetupClientFactory::GetInstance());
DependsOn(phonehub::PhoneHubManagerFactory::GetInstance());
DependsOn(SyncServiceFactory::GetInstance());
DependsOn(KerberosCredentialsManagerFactory::GetInstance());
DependsOn(ArcAppListPrefsFactory::GetInstance());
DependsOn(IdentityManagerFactory::GetInstance());
Expand All @@ -69,7 +67,6 @@ KeyedService* OsSettingsManagerFactory::BuildServiceInstanceFor(
GetForBrowserContext(context),
multidevice_setup::MultiDeviceSetupClientFactory::GetForProfile(profile),
phonehub::PhoneHubManagerFactory::GetForProfile(profile),
SyncServiceFactory::GetForProfile(profile),
KerberosCredentialsManagerFactory::Get(profile),
ArcAppListPrefsFactory::GetForBrowserContext(profile),
IdentityManagerFactory::GetForProfile(profile),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "chrome/browser/ash/phonehub/phone_hub_manager_factory.h"
#include "chrome/browser/ash/printing/cups_printers_manager_factory.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/sync/sync_service_factory.h"
#include "chrome/browser/ui/webui/settings/ash/constants/constants_util.h"
#include "chrome/browser/ui/webui/settings/ash/hierarchy.h"
#include "chrome/browser/ui/webui/settings/ash/os_settings_manager_factory.h"
Expand Down Expand Up @@ -76,7 +75,6 @@ class OsSettingsManagerTest : public testing::Test {
multidevice_setup::MultiDeviceSetupClientFactory::GetForProfile(
profile),
phonehub::PhoneHubManagerFactory::GetForProfile(profile),
SyncServiceFactory::GetForProfile(profile),
KerberosCredentialsManagerFactory::Get(profile),
ArcAppListPrefsFactory::GetForBrowserContext(profile),
IdentityManagerFactory::GetForProfile(profile),
Expand Down
8 changes: 3 additions & 5 deletions chrome/browser/ui/webui/settings/ash/os_settings_sections.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ OsSettingsSections::OsSettingsSections(
SearchTagRegistry* search_tag_registry,
multidevice_setup::MultiDeviceSetupClient* multidevice_setup_client,
phonehub::PhoneHubManager* phone_hub_manager,
syncer::SyncService* sync_service,
KerberosCredentialsManager* kerberos_credentials_manager,
ArcAppListPrefs* arc_app_list_prefs,
signin::IdentityManager* identity_manager,
Expand All @@ -66,10 +65,9 @@ OsSettingsSections::OsSettingsSections(
profile, search_tag_registry, multidevice_setup_client,
phone_hub_manager, android_sms_service, prefs, eche_app_manager));

AddSection(
mojom::Section::kPeople,
std::make_unique<PeopleSection>(profile, search_tag_registry,
sync_service, identity_manager, prefs));
AddSection(mojom::Section::kPeople,
std::make_unique<PeopleSection>(profile, search_tag_registry,
identity_manager, prefs));

AddSection(mojom::Section::kDevice, std::make_unique<DeviceSection>(
profile, search_tag_registry, prefs));
Expand Down
5 changes: 0 additions & 5 deletions chrome/browser/ui/webui/settings/ash/os_settings_sections.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ namespace signin {
class IdentityManager;
} // namespace signin

namespace syncer {
class SyncService;
} // namespace syncer

namespace ash {

class CupsPrintersManager;
Expand Down Expand Up @@ -51,7 +47,6 @@ class OsSettingsSections {
SearchTagRegistry* search_tag_registry,
multidevice_setup::MultiDeviceSetupClient* multidevice_setup_client,
phonehub::PhoneHubManager* phone_hub_manager,
syncer::SyncService* sync_service,
KerberosCredentialsManager* kerberos_credentials_manager,
ArcAppListPrefs* arc_app_list_prefs,
signin::IdentityManager* identity_manager,
Expand Down
4 changes: 0 additions & 4 deletions chrome/browser/ui/webui/settings/ash/people_section.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@
#include "components/prefs/pref_service.h"
#include "components/strings/grit/components_strings.h"
#include "components/sync/base/features.h"
#include "components/sync/service/sync_service.h"
#include "components/sync/service/sync_user_settings.h"
#include "components/user_manager/user.h"
#include "components/user_manager/user_manager.h"
#include "content/public/browser/web_ui.h"
Expand Down Expand Up @@ -491,10 +489,8 @@ bool IsSameAccount(const ::account_manager::AccountKey& account_key,

} // namespace

// TODO(https://crbug.com/1274802): Remove sync_service param.
PeopleSection::PeopleSection(Profile* profile,
SearchTagRegistry* search_tag_registry,
syncer::SyncService* sync_service,
signin::IdentityManager* identity_manager,
PrefService* pref_service)
: OsSettingsSection(profile, search_tag_registry),
Expand Down
6 changes: 0 additions & 6 deletions chrome/browser/ui/webui/settings/ash/people_section.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "components/account_manager_core/account_manager_facade.h"
#include "components/account_manager_core/chromeos/account_manager.h"
#include "components/prefs/pref_change_registrar.h"
#include "components/sync/service/sync_service_observer.h"

class PrefService;
class Profile;
Expand All @@ -29,10 +28,6 @@ namespace signin {
class IdentityManager;
} // namespace signin

namespace syncer {
class SyncService;
} // namespace syncer

namespace ash {

class AccountAppsAvailability;
Expand All @@ -52,7 +47,6 @@ class PeopleSection : public OsSettingsSection,
public:
PeopleSection(Profile* profile,
SearchTagRegistry* search_tag_registry,
syncer::SyncService* sync_service,
signin::IdentityManager* identity_manager,
PrefService* pref_service);
~PeopleSection() override;
Expand Down

0 comments on commit 267d5a5

Please sign in to comment.