Move //c/b/ash/account_manager to namespace ash

Read chrome/browser/ash/README.md for the rationale.

To avoid having to make namespace changes twice, code that will be
eventually moved to namespace ash is changed to additionally export its
symbols in the newer namespace.

This CL is part of the Chrome OS source code directory migration:
https://docs.google.com/document/d/1g-98HpzA8XcoGBWUv1gQNr4rbnD5yfvbtYZyPDDbkaE.

Bug: 1164001
Change-Id: Ia413e490af89a53cae945ca839c35f27bfd446fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2656596
Owners-Override: James Cook <[email protected]>
Commit-Queue: Henrique Ferreiro <[email protected]>
Reviewed-by: James Cook <[email protected]>
Cr-Commit-Position: refs/heads/master@{#848337}
diff --git a/chrome/browser/ash/README.md b/chrome/browser/ash/README.md
index 20cdbe4..82ab04e 100644
--- a/chrome/browser/ash/README.md
+++ b/chrome/browser/ash/README.md
@@ -4,6 +4,14 @@
 This directory should contain non-UI Chrome OS specific code that has
 `chrome/browser` dependencies.
 
+The code in this directory should live in namespace ash. While code in
+//chrome is not supposed to be in any namespace, //chrome/browser/ash is
+technically part of the ash binary. The fact that it lives in //chrome/browser
+instead of in //ash is because top level product directories shouldn't be
+depended on by any other directory. In the future, when some of the
+dependencies from //chrome/browser/ash to //chrome/browser are sorted out,
+some of this code will move to //ash.
+
 As of January 2021, code from
 [`chrome/browser/chromeos`](/chrome/browser/chromeos/README.md) is migrating
 into this directory, as part of the [Lacros project](/docs/lacros.md).
diff --git a/chrome/browser/ash/account_manager/account_manager_edu_coexistence_controller.cc b/chrome/browser/ash/account_manager/account_manager_edu_coexistence_controller.cc
index 7a0ed993..30741a11 100644
--- a/chrome/browser/ash/account_manager/account_manager_edu_coexistence_controller.cc
+++ b/chrome/browser/ash/account_manager/account_manager_edu_coexistence_controller.cc
@@ -17,7 +17,9 @@
 #include "components/prefs/pref_registry_simple.h"
 #include "components/prefs/pref_service.h"
 
-namespace chromeos {
+namespace ash {
+
+namespace edu_coexistence = ::chromeos::edu_coexistence;
 
 void EduCoexistenceConsentInvalidationController::RegisterProfilePrefs(
     PrefRegistrySimple* registry) {
@@ -45,7 +47,7 @@
       device_account_id_(device_account_id) {
   DCHECK(profile_);
   DCHECK(profile_->IsChild());
-  DCHECK(chromeos::IsAccountManagerAvailable(profile_));
+  DCHECK(IsAccountManagerAvailable(profile_));
 }
 
 EduCoexistenceConsentInvalidationController::
@@ -158,4 +160,4 @@
   }
 }
 
-}  // namespace chromeos
+}  // namespace ash
diff --git a/chrome/browser/ash/account_manager/account_manager_edu_coexistence_controller.h b/chrome/browser/ash/account_manager/account_manager_edu_coexistence_controller.h
index 026ff8e..150ce53 100644
--- a/chrome/browser/ash/account_manager/account_manager_edu_coexistence_controller.h
+++ b/chrome/browser/ash/account_manager/account_manager_edu_coexistence_controller.h
@@ -10,16 +10,17 @@
 
 #include "base/callback.h"
 #include "base/memory/weak_ptr.h"
+// TODO(https://crbug.com/1164001): move to forward declaration when migrated to
+// ash/components/.
+#include "chromeos/components/account_manager/account_manager.h"
 #include "components/account_id/account_id.h"
 #include "components/account_manager_core/account.h"
 #include "components/prefs/pref_change_registrar.h"
 
-class Profile;
 class PrefRegistrySimple;
+class Profile;
 
-namespace chromeos {
-
-class AccountManager;
+namespace ash {
 
 // Listens to changes to chromeos::prefs::kEduCoexistenceToSVersion policy
 // preference and invalidates secondary edu accounts with outdated terms of
@@ -66,6 +67,6 @@
       weak_factory_{this};
 };
 
-}  // namespace chromeos
+}  // namespace ash
 
 #endif  // CHROME_BROWSER_ASH_ACCOUNT_MANAGER_ACCOUNT_MANAGER_EDU_COEXISTENCE_CONTROLLER_H_
diff --git a/chrome/browser/ash/account_manager/account_manager_edu_coexistence_controller_unittest.cc b/chrome/browser/ash/account_manager/account_manager_edu_coexistence_controller_unittest.cc
index c3661a7..b21f3cf1 100644
--- a/chrome/browser/ash/account_manager/account_manager_edu_coexistence_controller_unittest.cc
+++ b/chrome/browser/ash/account_manager/account_manager_edu_coexistence_controller_unittest.cc
@@ -26,10 +26,12 @@
 #include "services/network/test/test_url_loader_factory.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-namespace chromeos {
+namespace ash {
 
 namespace {
 
+namespace edu_coexistence = ::chromeos::edu_coexistence;
+
 constexpr char kValidToken[] = "valid-token";
 
 constexpr char kPrimaryAccount[] = "[email protected]";
@@ -242,4 +244,4 @@
             "7");
 }
 
-}  // namespace chromeos
+}  // namespace ash
diff --git a/chrome/browser/ash/account_manager/account_manager_migrator.cc b/chrome/browser/ash/account_manager/account_manager_migrator.cc
index a6c3981b..f9dbbe8 100644
--- a/chrome/browser/ash/account_manager/account_manager_migrator.cc
+++ b/chrome/browser/ash/account_manager/account_manager_migrator.cc
@@ -47,7 +47,7 @@
 #include "components/webdata/common/web_data_service_consumer.h"
 #include "google_apis/gaia/gaia_auth_util.h"
 
-namespace chromeos {
+namespace ash {
 
 namespace {
 
@@ -497,7 +497,7 @@
 void AccountManagerMigrator::Start() {
   DVLOG(1) << "AccountManagerMigrator::Start";
 
-  if (!chromeos::IsAccountManagerAvailable(profile_))
+  if (!IsAccountManagerAvailable(profile_))
     return;
 
   if (migration_runner_ && (migration_runner_->GetStatus() ==
@@ -676,4 +676,4 @@
   return new AccountManagerMigrator(Profile::FromBrowserContext(context));
 }
 
-}  // namespace chromeos
+}  // namespace ash
diff --git a/chrome/browser/ash/account_manager/account_manager_migrator.h b/chrome/browser/ash/account_manager/account_manager_migrator.h
index 3c28dbd..1866e3a 100644
--- a/chrome/browser/ash/account_manager/account_manager_migrator.h
+++ b/chrome/browser/ash/account_manager/account_manager_migrator.h
@@ -21,7 +21,7 @@
 class NoDestructor;
 }  // namespace base
 
-namespace chromeos {
+namespace ash {
 
 class AccountManagerMigrator : public KeyedService {
  public:
@@ -94,6 +94,6 @@
   DISALLOW_COPY_AND_ASSIGN(AccountManagerMigratorFactory);
 };
 
-}  // namespace chromeos
+}  // namespace ash
 
 #endif  // CHROME_BROWSER_ASH_ACCOUNT_MANAGER_ACCOUNT_MANAGER_MIGRATOR_H_
diff --git a/chrome/browser/ash/account_manager/account_manager_policy_controller.cc b/chrome/browser/ash/account_manager/account_manager_policy_controller.cc
index db105b1b..01135e97 100644
--- a/chrome/browser/ash/account_manager/account_manager_policy_controller.cc
+++ b/chrome/browser/ash/account_manager/account_manager_policy_controller.cc
@@ -14,10 +14,11 @@
 #include "chrome/browser/chromeos/child_accounts/secondary_account_consent_logger.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/supervised_user/supervised_user_features.h"
+#include "chromeos/components/account_manager/account_manager.h"
 #include "chromeos/constants/chromeos_pref_names.h"
 #include "components/prefs/pref_service.h"
 
-namespace chromeos {
+namespace ash {
 
 AccountManagerPolicyController::AccountManagerPolicyController(
     Profile* profile,
@@ -34,7 +35,7 @@
 void AccountManagerPolicyController::Start() {
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
 
-  if (!chromeos::IsAccountManagerAvailable(profile_))
+  if (!IsAccountManagerAvailable(profile_))
     return;
 
   pref_change_registrar_.Init(profile_->GetPrefs());
@@ -46,8 +47,8 @@
   // Take any necessary initial action based on the current state of the pref.
   OnSecondaryAccountsSigninAllowedPrefChanged();
 
-  chromeos::ChildAccountTypeChangedUserData* user_data =
-      chromeos::ChildAccountTypeChangedUserData::GetForProfile(profile_);
+  ChildAccountTypeChangedUserData* user_data =
+      ChildAccountTypeChangedUserData::GetForProfile(profile_);
   child_account_type_changed_subscription_ =
       user_data->RegisterCallback(base::BindRepeating(
           &AccountManagerPolicyController::OnChildAccountTypeChanged,
@@ -174,4 +175,4 @@
   edu_coexistence_consent_invalidation_controller_.reset();
 }
 
-}  // namespace chromeos
+}  // namespace ash
diff --git a/chrome/browser/ash/account_manager/account_manager_policy_controller.h b/chrome/browser/ash/account_manager/account_manager_policy_controller.h
index 276a1145..a12103ed 100644
--- a/chrome/browser/ash/account_manager/account_manager_policy_controller.h
+++ b/chrome/browser/ash/account_manager/account_manager_policy_controller.h
@@ -12,6 +12,8 @@
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
 #include "chrome/browser/ash/account_manager/child_account_type_changed_user_data.h"
+// TODO(https://crbug.com/1164001): move to forward declaration when migrated to
+// ash/components/.
 #include "chromeos/components/account_manager/account_manager.h"
 #include "components/account_id/account_id.h"
 #include "components/account_manager_core/account.h"
@@ -21,9 +23,7 @@
 
 class Profile;
 
-namespace chromeos {
-
-class AccountManager;
+namespace ash {
 class EduCoexistenceConsentInvalidationController;
 
 class AccountManagerPolicyController : public KeyedService {
@@ -33,7 +33,7 @@
                                  const AccountId& device_account_id);
   ~AccountManagerPolicyController() override;
 
-  // Starts applying the behaviour required by |chromeos::AccountManager|
+  // Starts applying the behaviour required by |AccountManager|
   // specific prefs and policies.
   void Start();
 
@@ -84,6 +84,6 @@
   DISALLOW_COPY_AND_ASSIGN(AccountManagerPolicyController);
 };
 
-}  // namespace chromeos
+}  // namespace ash
 
 #endif  // CHROME_BROWSER_ASH_ACCOUNT_MANAGER_ACCOUNT_MANAGER_POLICY_CONTROLLER_H_
diff --git a/chrome/browser/ash/account_manager/account_manager_policy_controller_browsertest.cc b/chrome/browser/ash/account_manager/account_manager_policy_controller_browsertest.cc
index 65e050b5..48ec297 100644
--- a/chrome/browser/ash/account_manager/account_manager_policy_controller_browsertest.cc
+++ b/chrome/browser/ash/account_manager/account_manager_policy_controller_browsertest.cc
@@ -22,8 +22,7 @@
 #include "content/public/test/browser_test.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-namespace chromeos {
-
+namespace ash {
 namespace {
 constexpr char kFakePrimaryUsername[] = "[email protected]";
 constexpr char kFakeSecondaryUsername[] = "[email protected]";
@@ -133,8 +132,7 @@
   // (|true|).
   profile()->GetPrefs()->SetBoolean(
       chromeos::prefs::kSecondaryGoogleAccountSigninAllowed, true);
-  chromeos::ChildAccountTypeChangedUserData::GetForProfile(profile())->SetValue(
-      false);
+  ChildAccountTypeChangedUserData::GetForProfile(profile())->SetValue(false);
 
   // All accounts must be intact.
   accounts = GetAccountManagerAccounts();
@@ -181,8 +179,7 @@
   ASSERT_GT(initial_num_accounts, 1UL);
 
   // Disallow secondary account sign-ins.
-  chromeos::ChildAccountTypeChangedUserData::GetForProfile(profile())->SetValue(
-      true);
+  ChildAccountTypeChangedUserData::GetForProfile(profile())->SetValue(true);
 
   // Secondary Accounts must be removed.
   accounts = GetAccountManagerAccounts();
@@ -202,4 +199,4 @@
             accounts[0].key.id);
 }
 
-}  // namespace chromeos
+}  // namespace ash
diff --git a/chrome/browser/ash/account_manager/account_manager_policy_controller_factory.cc b/chrome/browser/ash/account_manager/account_manager_policy_controller_factory.cc
index 3d49ba17..ac58964 100644
--- a/chrome/browser/ash/account_manager/account_manager_policy_controller_factory.cc
+++ b/chrome/browser/ash/account_manager/account_manager_policy_controller_factory.cc
@@ -13,7 +13,7 @@
 #include "chromeos/components/account_manager/account_manager_factory.h"
 #include "components/keyed_service/content/browser_context_dependency_manager.h"
 
-namespace chromeos {
+namespace ash {
 
 // static
 AccountManagerPolicyController*
@@ -63,4 +63,4 @@
   return service;
 }
 
-}  // namespace chromeos
+}  // namespace ash
diff --git a/chrome/browser/ash/account_manager/account_manager_policy_controller_factory.h b/chrome/browser/ash/account_manager/account_manager_policy_controller_factory.h
index e75ff04..fd072710 100644
--- a/chrome/browser/ash/account_manager/account_manager_policy_controller_factory.h
+++ b/chrome/browser/ash/account_manager/account_manager_policy_controller_factory.h
@@ -15,8 +15,7 @@
 class NoDestructor;
 }  // namespace base
 
-namespace chromeos {
-
+namespace ash {
 class AccountManagerPolicyController;
 
 class AccountManagerPolicyControllerFactory
@@ -42,6 +41,6 @@
   DISALLOW_COPY_AND_ASSIGN(AccountManagerPolicyControllerFactory);
 };
 
-}  // namespace chromeos
+}  // namespace ash
 
 #endif  // CHROME_BROWSER_ASH_ACCOUNT_MANAGER_ACCOUNT_MANAGER_POLICY_CONTROLLER_FACTORY_H_
diff --git a/chrome/browser/ash/account_manager/account_manager_ui_impl.cc b/chrome/browser/ash/account_manager/account_manager_ui_impl.cc
index 3b26bc1..9b48fe5 100644
--- a/chrome/browser/ash/account_manager/account_manager_ui_impl.cc
+++ b/chrome/browser/ash/account_manager/account_manager_ui_impl.cc
@@ -5,7 +5,9 @@
 #include "chrome/browser/ash/account_manager/account_manager_ui_impl.h"
 #include "chrome/browser/ui/webui/signin/inline_login_dialog_chromeos.h"
 
-namespace chromeos {
+namespace ash {
+
+using ::chromeos::InlineLoginDialogChromeOS;
 
 AccountManagerUIImpl::AccountManagerUIImpl() = default;
 AccountManagerUIImpl::~AccountManagerUIImpl() = default;
@@ -25,4 +27,4 @@
   return InlineLoginDialogChromeOS::IsShown();
 }
 
-}  // namespace chromeos
+}  // namespace ash
diff --git a/chrome/browser/ash/account_manager/account_manager_ui_impl.h b/chrome/browser/ash/account_manager/account_manager_ui_impl.h
index 047bc5c..434004d 100644
--- a/chrome/browser/ash/account_manager/account_manager_ui_impl.h
+++ b/chrome/browser/ash/account_manager/account_manager_ui_impl.h
@@ -8,7 +8,7 @@
 #include "base/callback_forward.h"
 #include "chromeos/components/account_manager/account_manager_ui.h"
 
-namespace chromeos {
+namespace ash {
 
 class AccountManagerUIImpl : public AccountManagerUI {
  public:
@@ -25,6 +25,6 @@
   bool IsDialogShown() override;
 };
 
-}  // namespace chromeos
+}  // namespace ash
 
 #endif  // CHROME_BROWSER_ASH_ACCOUNT_MANAGER_ACCOUNT_MANAGER_UI_IMPL_H_
diff --git a/chrome/browser/ash/account_manager/account_manager_util.cc b/chrome/browser/ash/account_manager/account_manager_util.cc
index 4592886d..b635ae3 100644
--- a/chrome/browser/ash/account_manager/account_manager_util.cc
+++ b/chrome/browser/ash/account_manager/account_manager_util.cc
@@ -18,7 +18,7 @@
 #include "components/user_manager/user_manager.h"
 #include "services/network/public/cpp/shared_url_loader_factory.h"
 
-namespace chromeos {
+namespace ash {
 
 bool IsAccountManagerAvailable(const Profile* const profile) {
   // Signin Profile does not have any accounts associated with it,
@@ -63,4 +63,4 @@
       std::move(initialization_callback));
 }
 
-}  // namespace chromeos
+}  // namespace ash
diff --git a/chrome/browser/ash/account_manager/account_manager_util.h b/chrome/browser/ash/account_manager/account_manager_util.h
index 0f6284a3..e0b99680 100644
--- a/chrome/browser/ash/account_manager/account_manager_util.h
+++ b/chrome/browser/ash/account_manager/account_manager_util.h
@@ -10,7 +10,7 @@
 
 class Profile;
 
-namespace chromeos {
+namespace ash {
 
 bool IsAccountManagerAvailable(const Profile* const profile);
 
@@ -21,6 +21,6 @@
 void InitializeAccountManager(const base::FilePath& cryptohome_root_dir,
                               base::OnceClosure initialization_callback);
 
-}  // namespace chromeos
+}  // namespace ash
 
 #endif  // CHROME_BROWSER_ASH_ACCOUNT_MANAGER_ACCOUNT_MANAGER_UTIL_H_
diff --git a/chrome/browser/ash/account_manager/account_migration_runner.cc b/chrome/browser/ash/account_manager/account_migration_runner.cc
index 10a8c03..50532f0 100644
--- a/chrome/browser/ash/account_manager/account_migration_runner.cc
+++ b/chrome/browser/ash/account_manager/account_migration_runner.cc
@@ -10,7 +10,7 @@
 #include "base/bind.h"
 #include "base/metrics/histogram_functions.h"
 
-namespace chromeos {
+namespace ash {
 
 // Used in histograms.
 constexpr char kMigrationStepResultMetricName[] =
@@ -130,4 +130,4 @@
                                            failed_step_id /* failed_step */});
 }
 
-}  // namespace chromeos
+}  // namespace ash
diff --git a/chrome/browser/ash/account_manager/account_migration_runner.h b/chrome/browser/ash/account_manager/account_migration_runner.h
index 39f37c8..73fba57 100644
--- a/chrome/browser/ash/account_manager/account_migration_runner.h
+++ b/chrome/browser/ash/account_manager/account_migration_runner.h
@@ -14,7 +14,7 @@
 #include "base/memory/weak_ptr.h"
 #include "base/sequence_checker.h"
 
-namespace chromeos {
+namespace ash {
 
 // A utility class to run account migrations for |chromeos::AccountManager|. It
 // enables the specification of a series of async migration |Step|s in a
@@ -146,6 +146,6 @@
   DISALLOW_COPY_AND_ASSIGN(AccountMigrationRunner);
 };
 
-}  // namespace chromeos
+}  // namespace ash
 
 #endif  // CHROME_BROWSER_ASH_ACCOUNT_MANAGER_ACCOUNT_MIGRATION_RUNNER_H_
diff --git a/chrome/browser/ash/account_manager/account_migration_runner_unittest.cc b/chrome/browser/ash/account_manager/account_migration_runner_unittest.cc
index e27ecf4..0ca554e 100644
--- a/chrome/browser/ash/account_manager/account_migration_runner_unittest.cc
+++ b/chrome/browser/ash/account_manager/account_migration_runner_unittest.cc
@@ -15,7 +15,7 @@
 #include "base/test/task_environment.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-namespace chromeos {
+namespace ash {
 
 namespace {
 
@@ -196,4 +196,4 @@
   EXPECT_EQ(2, num_steps_executed_);
 }
 
-}  // namespace chromeos
+}  // namespace ash
diff --git a/chrome/browser/ash/account_manager/child_account_type_changed_user_data.cc b/chrome/browser/ash/account_manager/child_account_type_changed_user_data.cc
index 4e91653..d687062 100644
--- a/chrome/browser/ash/account_manager/child_account_type_changed_user_data.cc
+++ b/chrome/browser/ash/account_manager/child_account_type_changed_user_data.cc
@@ -6,7 +6,7 @@
 
 #include "chrome/browser/profiles/profile.h"
 
-namespace chromeos {
+namespace ash {
 
 namespace {
 const void* const kChildAccountTypeChangedUserDataUserKey =
@@ -47,4 +47,5 @@
     const base::RepeatingCallback<void(bool)>& cb) {
   return callback_list_.Add(cb);
 }
-}  // namespace chromeos
+
+}  // namespace ash
diff --git a/chrome/browser/ash/account_manager/child_account_type_changed_user_data.h b/chrome/browser/ash/account_manager/child_account_type_changed_user_data.h
index 39bbe05..6b350dde 100644
--- a/chrome/browser/ash/account_manager/child_account_type_changed_user_data.h
+++ b/chrome/browser/ash/account_manager/child_account_type_changed_user_data.h
@@ -11,7 +11,8 @@
 #include "base/supports_user_data.h"
 
 class Profile;
-namespace chromeos {
+
+namespace ash {
 
 class ChildAccountTypeChangedUserData : public base::SupportsUserData::Data {
  public:
@@ -36,6 +37,7 @@
   bool value_ = false;
   base::CallbackList<void(bool)> callback_list_;
 };
-}  // namespace chromeos
+
+}  // namespace ash
 
 #endif  // CHROME_BROWSER_ASH_ACCOUNT_MANAGER_CHILD_ACCOUNT_TYPE_CHANGED_USER_DATA_H_
diff --git a/chrome/browser/chromeos/arc/auth/arc_auth_service.cc b/chrome/browser/chromeos/arc/auth/arc_auth_service.cc
index 06247c6..ec42e5c 100644
--- a/chrome/browser/chromeos/arc/auth/arc_auth_service.cc
+++ b/chrome/browser/chromeos/arc/auth/arc_auth_service.cc
@@ -155,29 +155,29 @@
 }
 
 void TriggerAccountManagerMigrationsIfRequired(Profile* profile) {
-  if (!chromeos::IsAccountManagerAvailable(profile))
+  if (!ash::IsAccountManagerAvailable(profile))
     return;
 
-  chromeos::AccountManagerMigrator* const migrator =
-      chromeos::AccountManagerMigratorFactory::GetForBrowserContext(profile);
+  ash::AccountManagerMigrator* const migrator =
+      ash::AccountManagerMigratorFactory::GetForBrowserContext(profile);
   if (!migrator) {
     // Migrator can be null for ephemeral and kiosk sessions. Ignore those cases
     // since there are no accounts to be migrated in that case.
     return;
   }
-  const base::Optional<chromeos::AccountMigrationRunner::MigrationResult>
+  const base::Optional<ash::AccountMigrationRunner::MigrationResult>
       last_migration_run_result = migrator->GetLastMigrationRunResult();
 
   if (!last_migration_run_result)
     return;
 
   if (last_migration_run_result->final_status !=
-      chromeos::AccountMigrationRunner::Status::kFailure) {
+      ash::AccountMigrationRunner::Status::kFailure) {
     return;
   }
 
   if (last_migration_run_result->failed_step_id !=
-      chromeos::AccountManagerMigrator::kArcAccountsMigrationId) {
+      ash::AccountManagerMigrator::kArcAccountsMigrationId) {
     // Migrations failed but not because of ARC. ARC should not try to re-run
     // migrations in this case.
     return;
@@ -504,25 +504,25 @@
 
 void ArcAuthService::IsAccountManagerAvailable(
     IsAccountManagerAvailableCallback callback) {
-  std::move(callback).Run(chromeos::IsAccountManagerAvailable(profile_));
+  std::move(callback).Run(ash::IsAccountManagerAvailable(profile_));
 }
 
 void ArcAuthService::HandleAddAccountRequest() {
-  DCHECK(chromeos::IsAccountManagerAvailable(profile_));
+  DCHECK(ash::IsAccountManagerAvailable(profile_));
 
   chromeos::InlineLoginDialogChromeOS::ShowDeprecated(
       ::account_manager::AccountManagerFacade::AccountAdditionSource::kArc);
 }
 
 void ArcAuthService::HandleRemoveAccountRequest(const std::string& email) {
-  DCHECK(chromeos::IsAccountManagerAvailable(profile_));
+  DCHECK(ash::IsAccountManagerAvailable(profile_));
 
   chrome::SettingsWindowManager::GetInstance()->ShowOSSettings(
       profile_, chromeos::settings::mojom::kMyAccountsSubpagePath);
 }
 
 void ArcAuthService::HandleUpdateCredentialsRequest(const std::string& email) {
-  DCHECK(chromeos::IsAccountManagerAvailable(profile_));
+  DCHECK(ash::IsAccountManagerAvailable(profile_));
 
   chromeos::InlineLoginDialogChromeOS::ShowDeprecated(
       email,
@@ -535,7 +535,7 @@
   // proper Profile independent entity once we have that.
   DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
 
-  if (!chromeos::IsAccountManagerAvailable(profile_))
+  if (!ash::IsAccountManagerAvailable(profile_))
     return;
 
   // Ignore the update if ARC has not been provisioned yet.
@@ -571,7 +571,7 @@
     const AccountInfo& account_info) {
   DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
 
-  if (!chromeos::IsAccountManagerAvailable(profile_))
+  if (!ash::IsAccountManagerAvailable(profile_))
     return;
 
   DCHECK(!IsPrimaryGaiaAccount(account_info.gaia));
@@ -801,7 +801,7 @@
 }
 
 void ArcAuthService::TriggerAccountsPushToArc(bool filter_primary_account) {
-  if (!chromeos::IsAccountManagerAvailable(profile_))
+  if (!ash::IsAccountManagerAvailable(profile_))
     return;
 
   const std::vector<CoreAccountInfo> accounts =
diff --git a/chrome/browser/chromeos/browser_context_keyed_service_factories.cc b/chrome/browser/chromeos/browser_context_keyed_service_factories.cc
index 0ee5e65..c3921bb 100644
--- a/chrome/browser/chromeos/browser_context_keyed_service_factories.cc
+++ b/chrome/browser/chromeos/browser_context_keyed_service_factories.cc
@@ -53,6 +53,8 @@
 
 namespace chromeos {
 
+using ::ash::AccountManagerMigratorFactory;
+
 void EnsureBrowserContextKeyedServiceFactoriesBuilt() {
   AccountManagerMigratorFactory::GetInstance();
   android_sms::AndroidSmsServiceFactory::GetInstance();
diff --git a/chrome/browser/chromeos/login/session/user_session_manager.cc b/chrome/browser/chromeos/login/session/user_session_manager.cc
index d132c769..cc4f071a 100644
--- a/chrome/browser/chromeos/login/session/user_session_manager.cc
+++ b/chrome/browser/chromeos/login/session/user_session_manager.cc
@@ -159,12 +159,13 @@
 #include "ui/base/ime/chromeos/input_method_util.h"
 #include "url/gurl.h"
 
-using signin::ConsentLevel;
-
 namespace chromeos {
 
 namespace {
 
+using ::ash::AccountManagerMigratorFactory;
+using ::signin::ConsentLevel;
+
 // Time to wait for child policy refresh. If that time is exceeded session
 // should start with cached policy.
 constexpr base::TimeDelta kWaitForChildPolicyTimeout =
@@ -1142,7 +1143,7 @@
       ProfileHelper::GetProfilePathByUserIdHash(user_context_.GetUserIDHash());
 
   if (ProfileHelper::IsRegularProfilePath(profile_path)) {
-    chromeos::InitializeAccountManager(
+    ash::InitializeAccountManager(
         profile_path,
         base::BindOnce(&UserSessionManager::PrepareProfile, AsWeakPtr(),
                        profile_path) /* initialization_callback */);
@@ -2051,8 +2052,7 @@
 
 void UserSessionManager::StartAccountManagerMigration(Profile* profile) {
   // `migrator` is nullptr for incognito profiles.
-  auto* migrator =
-      chromeos::AccountManagerMigratorFactory::GetForBrowserContext(profile);
+  auto* migrator = AccountManagerMigratorFactory::GetForBrowserContext(profile);
   if (migrator)
     migrator->Start();
 }
diff --git a/chrome/browser/chromeos/login/signin/signin_error_notifier_ash.cc b/chrome/browser/chromeos/login/signin/signin_error_notifier_ash.cc
index 58f2435..0f7ef6a0 100644
--- a/chrome/browser/chromeos/login/signin/signin_error_notifier_ash.cc
+++ b/chrome/browser/chromeos/login/signin/signin_error_notifier_ash.cc
@@ -168,7 +168,7 @@
 
   const AccountId account_id =
       multi_user_util::GetAccountIdFromProfile(profile_);
-  if (!chromeos::IsAccountManagerAvailable(profile_)) {
+  if (!ash::IsAccountManagerAvailable(profile_)) {
     // If this flag is disabled, Chrome OS does not have a concept of Secondary
     // Accounts. Preserve existing behavior.
     RecordReauthReason(account_id, chromeos::ReauthReason::SYNC_FAILED);
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 6788f985..353400f 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -1044,7 +1044,7 @@
   chromeos::RegisterSamlProfilePrefs(registry);
   chromeos::ScreenTimeController::RegisterProfilePrefs(registry);
   SecondaryAccountConsentLogger::RegisterPrefs(registry);
-  chromeos::EduCoexistenceConsentInvalidationController::RegisterProfilePrefs(
+  ash::EduCoexistenceConsentInvalidationController::RegisterProfilePrefs(
       registry);
   SigninErrorNotifier::RegisterPrefs(registry);
   chromeos::ServicesCustomizationDocument::RegisterProfilePrefs(registry);
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index 40e89a1..6448724 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -532,14 +532,14 @@
 
 #if BUILDFLAG(IS_CHROMEOS_ASH)
   if (is_regular_profile) {
-    // |chromeos::InitializeAccountManager| is called during a User's session
+    // |ash::InitializeAccountManager| is called during a User's session
     // initialization but some tests do not properly login to a User Session.
-    // This invocation of |chromeos::InitializeAccountManager| is used only
-    // during tests.
-    // Note: |chromeos::InitializeAccountManager| is idempotent and safe to call
+    // This invocation of |ash::InitializeAccountManager| is used only during
+    // tests.
+    // Note: |ash::InitializeAccountManager| is idempotent and safe to call
     // multiple times.
     // TODO(https://crbug.com/982233): Remove this call.
-    chromeos::InitializeAccountManager(
+    ash::InitializeAccountManager(
         path_, base::DoNothing() /* initialization_callback */);
 
     chromeos::AccountManager* account_manager =
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index a7930ea..701ecf8a 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -1114,11 +1114,11 @@
       }
       profile->GetPrefs()->SetInteger(arc::prefs::kArcSupervisionTransition,
                                       static_cast<int>(supervisionTransition));
-      chromeos::ChildAccountTypeChangedUserData::GetForProfile(profile)
-          ->SetValue(true);
+      ash::ChildAccountTypeChangedUserData::GetForProfile(profile)->SetValue(
+          true);
     } else {
-      chromeos::ChildAccountTypeChangedUserData::GetForProfile(profile)
-          ->SetValue(false);
+      ash::ChildAccountTypeChangedUserData::GetForProfile(profile)->SetValue(
+          false);
     }
 
     if (user_is_child) {
@@ -1475,8 +1475,7 @@
   AccessibilityLabelsServiceFactory::GetForProfile(profile)->Init();
 
 #if BUILDFLAG(IS_CHROMEOS_ASH)
-  chromeos::AccountManagerPolicyControllerFactory::GetForBrowserContext(
-      profile);
+  ash::AccountManagerPolicyControllerFactory::GetForBrowserContext(profile);
 #endif
 
   // Creates the LiteVideo Keyed Service and begins loading the
diff --git a/chrome/browser/signin/account_consistency_mode_manager.cc b/chrome/browser/signin/account_consistency_mode_manager.cc
index 8f43f97..cffefa4b 100644
--- a/chrome/browser/signin/account_consistency_mode_manager.cc
+++ b/chrome/browser/signin/account_consistency_mode_manager.cc
@@ -198,7 +198,7 @@
 #endif
 
 #if BUILDFLAG(IS_CHROMEOS_ASH)
-  return chromeos::IsAccountManagerAvailable(profile)
+  return ash::IsAccountManagerAvailable(profile)
              ? AccountConsistencyMethod::kMirror
              : AccountConsistencyMethod::kDisabled;
 #endif
diff --git a/chrome/browser/signin/account_reconcilor_factory.cc b/chrome/browser/signin/account_reconcilor_factory.cc
index aa8a6cf5..36bc499 100644
--- a/chrome/browser/signin/account_reconcilor_factory.cc
+++ b/chrome/browser/signin/account_reconcilor_factory.cc
@@ -120,7 +120,7 @@
  public:
   ChromeOSAccountReconcilorDelegate(
       signin::IdentityManager* identity_manager,
-      chromeos::AccountManagerMigrator* account_migrator)
+      ash::AccountManagerMigrator* account_migrator)
       : signin::MirrorAccountReconcilorDelegate(identity_manager),
         account_migrator_(account_migrator) {}
   ~ChromeOSAccountReconcilorDelegate() override = default;
@@ -132,14 +132,14 @@
       return false;
     }
 
-    const chromeos::AccountMigrationRunner::Status status =
+    const ash::AccountMigrationRunner::Status status =
         account_migrator_->GetStatus();
-    return status != chromeos::AccountMigrationRunner::Status::kNotStarted &&
-           status != chromeos::AccountMigrationRunner::Status::kRunning;
+    return status != ash::AccountMigrationRunner::Status::kNotStarted &&
+           status != ash::AccountMigrationRunner::Status::kRunning;
   }
 
   // A non-owning pointer.
-  const chromeos::AccountManagerMigrator* const account_migrator_;
+  const ash::AccountManagerMigrator* const account_migrator_;
 
   DISALLOW_COPY_AND_ASSIGN(ChromeOSAccountReconcilorDelegate);
 };
@@ -211,7 +211,7 @@
       // TODO(https://crbug.com/993317): Remove the check for
       // |IsAccountManagerAvailable| after fixing https://crbug.com/1008349 and
       // https://crbug.com/993317.
-      if (chromeos::IsAccountManagerAvailable(profile) &&
+      if (ash::IsAccountManagerAvailable(profile) &&
           chromeos::InstallAttributes::Get()->IsActiveDirectoryManaged()) {
         return std::make_unique<
             signin::ActiveDirectoryAccountReconcilorDelegate>();
@@ -229,8 +229,7 @@
       // users have been migrated to Account Manager.
       return std::make_unique<ChromeOSAccountReconcilorDelegate>(
           IdentityManagerFactory::GetForProfile(profile),
-          chromeos::AccountManagerMigratorFactory::GetForBrowserContext(
-              profile));
+          ash::AccountManagerMigratorFactory::GetForBrowserContext(profile));
 #endif
       return std::make_unique<signin::MirrorAccountReconcilorDelegate>(
           IdentityManagerFactory::GetForProfile(profile));
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
index c0ed6e19..0f39a5e 100644
--- a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
+++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
@@ -712,7 +712,7 @@
   DCHECK(profile);
 
 #if BUILDFLAG(IS_CHROMEOS_ASH)
-  if (chromeos::IsAccountManagerAvailable(profile)) {
+  if (ash::IsAccountManagerAvailable(profile)) {
     // Chrome OS Account Manager is enabled on this Profile and hence, all
     // account management flows will go through native UIs and not through a
     // tabbed browser window.
diff --git a/chrome/browser/ui/webui/settings/chromeos/people_section.cc b/chrome/browser/ui/webui/settings/chromeos/people_section.cc
index 2bf8f8fb..bcf9c1cd 100644
--- a/chrome/browser/ui/webui/settings/chromeos/people_section.cc
+++ b/chrome/browser/ui/webui/settings/chromeos/people_section.cc
@@ -60,6 +60,8 @@
 namespace settings {
 namespace {
 
+using ::ash::IsAccountManagerAvailable;
+
 const std::vector<SearchConcept>& GetPeopleSearchConcepts() {
   static const base::NoDestructor<std::vector<SearchConcept>> tags([] {
     std::vector<SearchConcept> all_tags({
diff --git a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
index 988bb11..03f096b 100644
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -1250,7 +1250,7 @@
 #if BUILDFLAG(IS_CHROMEOS_ASH)
   // Toggles the Chrome OS Account Manager submenu in the People section.
   html_source->AddBoolean("isAccountManagerEnabled",
-                          chromeos::IsAccountManagerAvailable(profile));
+                          ash::IsAccountManagerAvailable(profile));
 #elif BUILDFLAG(IS_CHROMEOS_LACROS)
   html_source->AddBoolean("isAccountManagerEnabled",
                           IsAccountManagerAvailable(profile));
diff --git a/chrome/browser/ui/webui/settings/settings_ui.cc b/chrome/browser/ui/webui/settings/settings_ui.cc
index 8f51463..2f69077 100644
--- a/chrome/browser/ui/webui/settings/settings_ui.cc
+++ b/chrome/browser/ui/webui/settings/settings_ui.cc
@@ -379,7 +379,7 @@
 
   // TODO(jamescook): Sort out how account management is split between Chrome OS
   // and browser settings.
-  if (chromeos::IsAccountManagerAvailable(profile)) {
+  if (ash::IsAccountManagerAvailable(profile)) {
     chromeos::AccountManagerFactory* factory =
         g_browser_process->platform_part()->GetAccountManagerFactory();
     chromeos::AccountManager* account_manager =
diff --git a/chrome/browser/ui/webui/signin/inline_login_dialog_chromeos.h b/chrome/browser/ui/webui/signin/inline_login_dialog_chromeos.h
index cbaf956..ca1e1be 100644
--- a/chrome/browser/ui/webui/signin/inline_login_dialog_chromeos.h
+++ b/chrome/browser/ui/webui/signin/inline_login_dialog_chromeos.h
@@ -17,6 +17,10 @@
 
 class GURL;
 
+namespace ash {
+class AccountManagerUIImpl;
+}
+
 namespace chromeos {
 
 // Extends from |SystemWebDialogDelegate| to create an always-on-top but movable
@@ -99,7 +103,7 @@
  private:
   // `Show` method can be called directly only by `AccountManagerUIImpl` class.
   // To show the dialog, use `AccountManagerFacade`.
-  friend class AccountManagerUIImpl;
+  friend class ash::AccountManagerUIImpl;
 
   // Displays the dialog. |close_dialog_closure| will be called when the dialog
   // is closed.
diff --git a/chromeos/components/account_manager/account_manager.h b/chromeos/components/account_manager/account_manager.h
index ecd3464..36e06db 100644
--- a/chromeos/components/account_manager/account_manager.h
+++ b/chromeos/components/account_manager/account_manager.h
@@ -421,4 +421,9 @@
 
 }  // namespace chromeos
 
+// TODO(https://crbug.com/1164001): remove after moved to ash/.
+namespace ash {
+using ::chromeos::AccountManager;
+}
+
 #endif  // CHROMEOS_COMPONENTS_ACCOUNT_MANAGER_ACCOUNT_MANAGER_H_
diff --git a/chromeos/components/account_manager/account_manager_factory.h b/chromeos/components/account_manager/account_manager_factory.h
index 2931137..4e7c17a 100644
--- a/chromeos/components/account_manager/account_manager_factory.h
+++ b/chromeos/components/account_manager/account_manager_factory.h
@@ -64,4 +64,9 @@
 
 }  // namespace chromeos
 
+// TODO(https://crbug.com/1164001): remove after moved to ash/.
+namespace ash {
+using ::chromeos::AccountManagerFactory;
+}
+
 #endif  // CHROMEOS_COMPONENTS_ACCOUNT_MANAGER_ACCOUNT_MANAGER_FACTORY_H_
diff --git a/chromeos/components/account_manager/account_manager_ui.h b/chromeos/components/account_manager/account_manager_ui.h
index 2adb8f3..9b2952a 100644
--- a/chromeos/components/account_manager/account_manager_ui.h
+++ b/chromeos/components/account_manager/account_manager_ui.h
@@ -36,4 +36,9 @@
 
 }  // namespace chromeos
 
+// TODO(https://crbug.com/1164001): remove after moved to ash/
+namespace ash {
+using ::chromeos::AccountManagerUI;
+}
+
 #endif  // CHROMEOS_COMPONENTS_ACCOUNT_MANAGER_ACCOUNT_MANAGER_UI_H_