Move chrome/browser/ash/login/signin/ to namespace ash

The migration of chromeos/browser/chromeos/login/signin/ was finished in
https://crrev.com/c/2716446. This CL changes the namespace from chromeos
to ash. Compatibility code is added until the Chrome OS source code
migration is finished.

As part of this CL, some files in the global or other namespaces were
moved to ash and SigninErrorNotifier/Factory files were renamed to drop
the _ash.* suffix.

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

Bug: 1164001
Change-Id: I5c3622db4d320be9105711919ac3d82528f8dc92
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3034892
Commit-Queue: Henrique Ferreiro <[email protected]>
Reviewed-by: Hidehiko Abe <[email protected]>
Owners-Override: Hidehiko Abe <[email protected]>
Cr-Commit-Position: refs/heads/master@{#903378}
diff --git a/chrome/browser/ash/login/existing_user_controller.h b/chrome/browser/ash/login/existing_user_controller.h
index d85dcfe..f3e1fcf6 100644
--- a/chrome/browser/ash/login/existing_user_controller.h
+++ b/chrome/browser/ash/login/existing_user_controller.h
@@ -26,6 +26,8 @@
 #include "chrome/browser/ash/login/saml/password_sync_token_checkers_collection.h"
 #include "chrome/browser/ash/login/screens/encryption_migration_mode.h"
 #include "chrome/browser/ash/login/session/user_session_manager.h"
+// TODO(https://crbug.com/1164001): move to forward declaration.
+#include "chrome/browser/ash/login/signin/oauth2_token_initializer.h"
 #include "chrome/browser/ash/login/ui/login_display.h"
 // TODO(https://crbug.com/1164001): move CrosSettings to forward declaration
 // when moved to chrome/browser/ash/.
@@ -51,7 +53,6 @@
 
 namespace chromeos {
 class LoginDisplay;
-class OAuth2TokenInitializer;
 
 namespace login {
 class NetworkStateHelper;
diff --git a/chrome/browser/ash/login/login_constants.h b/chrome/browser/ash/login/login_constants.h
index b862a95..4bdcd66 100644
--- a/chrome/browser/ash/login/login_constants.h
+++ b/chrome/browser/ash/login/login_constants.h
@@ -57,6 +57,8 @@
 using ::chromeos::constants::kDefaultSamlPasswordExpirationAdvanceWarningDays;
 using ::chromeos::constants::kDefaultSamlInSessionPasswordChangeEnabled;
 using ::chromeos::constants::kDefaultSamlLockScreenOfflineSigninTimeLimitDays;
+using ::chromeos::constants::kLockScreenOfflineSigninTimeLimitDaysMatchLogin;
+using ::chromeos::constants::kOfflineSigninTimeLimitNotSet;
 }  // namespace constants
 }  // namespace ash
 
diff --git a/chrome/browser/ash/login/password_change_browsertest.cc b/chrome/browser/ash/login/password_change_browsertest.cc
index c605283..d420e07 100644
--- a/chrome/browser/ash/login/password_change_browsertest.cc
+++ b/chrome/browser/ash/login/password_change_browsertest.cc
@@ -18,7 +18,7 @@
 #include "chrome/browser/ash/login/reauth_stats.h"
 #include "chrome/browser/ash/login/session/user_session_manager.h"
 #include "chrome/browser/ash/login/session/user_session_manager_test_api.h"
-#include "chrome/browser/ash/login/signin/signin_error_notifier_ash.h"
+#include "chrome/browser/ash/login/signin/signin_error_notifier.h"
 #include "chrome/browser/ash/login/signin_specifics.h"
 #include "chrome/browser/ash/login/test/js_checker.h"
 #include "chrome/browser/ash/login/test/login_manager_mixin.h"
diff --git a/chrome/browser/ash/login/session/user_session_manager.h b/chrome/browser/ash/login/session/user_session_manager.h
index 816045d..e6fd255c 100644
--- a/chrome/browser/ash/login/session/user_session_manager.h
+++ b/chrome/browser/ash/login/session/user_session_manager.h
@@ -57,7 +57,6 @@
 class PrefRegistrySimple;
 class PrefService;
 class Profile;
-class TokenHandleFetcher;
 class TurnSyncOnHelper;
 
 namespace user_manager {
@@ -67,6 +66,7 @@
 namespace ash {
 class LoginDisplayHost;
 class OnboardingUserActivityCounter;
+class TokenHandleFetcher;
 
 namespace test {
 class UserSessionManagerTestApi;
diff --git a/chrome/browser/ash/login/signin/auth_error_observer.cc b/chrome/browser/ash/login/signin/auth_error_observer.cc
index ac9a8f5..a7c01260c 100644
--- a/chrome/browser/ash/login/signin/auth_error_observer.cc
+++ b/chrome/browser/ash/login/signin/auth_error_observer.cc
@@ -18,7 +18,7 @@
 #include "components/sync/driver/sync_service.h"
 #include "components/user_manager/user_manager.h"
 
-namespace chromeos {
+namespace ash {
 
 // static
 bool AuthErrorObserver::ShouldObserve(Profile* profile) {
@@ -100,4 +100,4 @@
   }
 }
 
-}  // namespace chromeos
+}  // namespace ash
diff --git a/chrome/browser/ash/login/signin/auth_error_observer.h b/chrome/browser/ash/login/signin/auth_error_observer.h
index ab1586f8..d45359bb 100644
--- a/chrome/browser/ash/login/signin/auth_error_observer.h
+++ b/chrome/browser/ash/login/signin/auth_error_observer.h
@@ -13,7 +13,7 @@
 class GoogleServiceAuthError;
 class Profile;
 
-namespace chromeos {
+namespace ash {
 
 // This class is responsible for detecting authentication problems reported
 // by sync service and SigninErrorController on a user profile.
@@ -54,6 +54,6 @@
   DISALLOW_COPY_AND_ASSIGN(AuthErrorObserver);
 };
 
-}  // namespace chromeos
+}  // namespace ash
 
 #endif  // CHROME_BROWSER_ASH_LOGIN_SIGNIN_AUTH_ERROR_OBSERVER_H_
diff --git a/chrome/browser/ash/login/signin/auth_error_observer_factory.cc b/chrome/browser/ash/login/signin/auth_error_observer_factory.cc
index e1689894..8b13f27 100644
--- a/chrome/browser/ash/login/signin/auth_error_observer_factory.cc
+++ b/chrome/browser/ash/login/signin/auth_error_observer_factory.cc
@@ -10,7 +10,7 @@
 #include "chrome/browser/sync/sync_service_factory.h"
 #include "components/keyed_service/content/browser_context_dependency_manager.h"
 
-namespace chromeos {
+namespace ash {
 
 AuthErrorObserverFactory::AuthErrorObserverFactory()
     : BrowserContextKeyedServiceFactory(
@@ -42,4 +42,4 @@
   return new AuthErrorObserver(profile);
 }
 
-}  // namespace chromeos
+}  // namespace ash
diff --git a/chrome/browser/ash/login/signin/auth_error_observer_factory.h b/chrome/browser/ash/login/signin/auth_error_observer_factory.h
index 05d8422..025e1a0 100644
--- a/chrome/browser/ash/login/signin/auth_error_observer_factory.h
+++ b/chrome/browser/ash/login/signin/auth_error_observer_factory.h
@@ -11,8 +11,7 @@
 
 class Profile;
 
-namespace chromeos {
-
+namespace ash {
 class AuthErrorObserver;
 
 // Singleton that owns all AuthErrorObserver and associates them with
@@ -40,6 +39,6 @@
   DISALLOW_COPY_AND_ASSIGN(AuthErrorObserverFactory);
 };
 
-}  // namespace chromeos
+}  // namespace ash
 
 #endif  // CHROME_BROWSER_ASH_LOGIN_SIGNIN_AUTH_ERROR_OBSERVER_FACTORY_H_
diff --git a/chrome/browser/ash/login/signin/device_id_browsertest.cc b/chrome/browser/ash/login/signin/device_id_browsertest.cc
index 2a96292..1f6d649 100644
--- a/chrome/browser/ash/login/signin/device_id_browsertest.cc
+++ b/chrome/browser/ash/login/signin/device_id_browsertest.cc
@@ -29,6 +29,7 @@
 #include "components/user_manager/user_manager.h"
 #include "content/public/test/browser_test.h"
 
+namespace ash {
 namespace {
 
 char kRefreshToken1[] = "refresh_token_1";
@@ -44,8 +45,6 @@
 
 }  // namespace
 
-namespace chromeos {
-
 class DeviceIDTest : public OobeBaseTest,
                      public user_manager::UserManager::Observer {
  public:
@@ -120,14 +119,14 @@
   }
 
   void SignInOffline(const std::string& user_id, const std::string& password) {
-    ash::LoginScreenTestApi::SubmitPassword(AccountId::FromUserEmail(user_id),
-                                            FakeGaiaMixin::kFakeUserPassword,
-                                            false /* check_if_submittable */);
+    LoginScreenTestApi::SubmitPassword(AccountId::FromUserEmail(user_id),
+                                       FakeGaiaMixin::kFakeUserPassword,
+                                       false /* check_if_submittable */);
     test::WaitForPrimaryUserSessionStart();
   }
 
   void RemoveUser(const AccountId& account_id) {
-    ASSERT_TRUE(ash::LoginScreenTestApi::RemoveUser(account_id));
+    ASSERT_TRUE(LoginScreenTestApi::RemoveUser(account_id));
     user_removal_loop_->Run();
   }
 
@@ -190,7 +189,7 @@
   EXPECT_FALSE(device_id.empty());
   EXPECT_EQ(device_id, GetDeviceIdFromGAIA(kRefreshToken1));
 
-  ASSERT_TRUE(ash::LoginScreenTestApi::ClickAddUserButton());
+  ASSERT_TRUE(LoginScreenTestApi::ClickAddUserButton());
   SignInOnline(FakeGaiaMixin::kFakeUserEmail, FakeGaiaMixin::kFakeUserPassword,
                kRefreshToken2, FakeGaiaMixin::kFakeUserGaiaId);
   CheckDeviceIDIsConsistent(
@@ -221,7 +220,7 @@
 
 // Add the second user.
 IN_PROC_BROWSER_TEST_F(DeviceIDTest, PRE_PRE_NewUsers) {
-  ASSERT_TRUE(ash::LoginScreenTestApi::ClickAddUserButton());
+  ASSERT_TRUE(LoginScreenTestApi::ClickAddUserButton());
   SignInOnline(kSecondUserEmail, kSecondUserPassword, kSecondUserRefreshToken1,
                kSecondUserGaiaId);
   CheckDeviceIDIsConsistent(AccountId::FromUserEmail(kSecondUserEmail),
@@ -236,7 +235,7 @@
 // Add the second user back. Verify that device ID has been changed.
 IN_PROC_BROWSER_TEST_F(DeviceIDTest, NewUsers) {
   EXPECT_TRUE(GetDeviceId(AccountId::FromUserEmail(kSecondUserEmail)).empty());
-  ASSERT_TRUE(ash::LoginScreenTestApi::ClickAddUserButton());
+  ASSERT_TRUE(LoginScreenTestApi::ClickAddUserButton());
   SignInOnline(kSecondUserEmail, kSecondUserPassword, kSecondUserRefreshToken2,
                kSecondUserGaiaId);
   CheckDeviceIDIsConsistent(AccountId::FromUserEmail(kSecondUserEmail),
@@ -310,4 +309,4 @@
       AccountId::FromUserEmail(FakeGaiaMixin::kFakeUserEmail), std::string());
 }
 
-}  // namespace chromeos
+}  // namespace ash
diff --git a/chrome/browser/ash/login/signin/merge_session_navigation_throttle.cc b/chrome/browser/ash/login/signin/merge_session_navigation_throttle.cc
index 743e63e..6c90d97 100644
--- a/chrome/browser/ash/login/signin/merge_session_navigation_throttle.cc
+++ b/chrome/browser/ash/login/signin/merge_session_navigation_throttle.cc
@@ -11,13 +11,13 @@
 #include "content/public/browser/navigation_handle.h"
 #include "content/public/browser/web_contents.h"
 
+namespace ash {
 namespace {
 
 // Maximum wait time for merge session process.
 constexpr base::TimeDelta kTotalWaitTime = base::TimeDelta::FromSeconds(10);
 
-chromeos::OAuth2LoginManager* GetOAuth2LoginManager(
-    content::WebContents* web_contents) {
+OAuth2LoginManager* GetOAuth2LoginManager(content::WebContents* web_contents) {
   content::BrowserContext* browser_context = web_contents->GetBrowserContext();
   if (!browser_context)
     return nullptr;
@@ -26,9 +26,9 @@
   if (!profile)
     return nullptr;
 
-  return chromeos::OAuth2LoginManagerFactory::GetInstance()->GetForProfile(
-      profile);
+  return OAuth2LoginManagerFactory::GetInstance()->GetForProfile(profile);
 }
+
 }  // namespace
 
 // static
@@ -75,17 +75,15 @@
 
 void MergeSessionNavigationThrottle::OnSessionRestoreStateChanged(
     Profile* user_profile,
-    chromeos::OAuth2LoginManager::SessionRestoreState state) {
-  chromeos::OAuth2LoginManager* manager =
-      GetOAuth2LoginManager(navigation_handle()->GetWebContents());
+    OAuth2LoginManager::SessionRestoreState state) {
+  auto* manager = GetOAuth2LoginManager(navigation_handle()->GetWebContents());
   if (!manager->ShouldBlockTabLoading()) {
     Proceed();
   }
 }
 
 bool MergeSessionNavigationThrottle::BeforeDefer() {
-  chromeos::OAuth2LoginManager* manager =
-      GetOAuth2LoginManager(navigation_handle()->GetWebContents());
+  auto* manager = GetOAuth2LoginManager(navigation_handle()->GetWebContents());
   if (manager && manager->ShouldBlockTabLoading()) {
     login_manager_observation_.Observe(manager);
     proceed_timer_.Start(FROM_HERE, kTotalWaitTime, this,
@@ -97,11 +95,12 @@
 
 void MergeSessionNavigationThrottle::Proceed() {
   proceed_timer_.Stop();
-  chromeos::OAuth2LoginManager* manager =
-      GetOAuth2LoginManager(navigation_handle()->GetWebContents());
+  auto* manager = GetOAuth2LoginManager(navigation_handle()->GetWebContents());
   if (manager) {
     DCHECK(login_manager_observation_.IsObservingSource(manager));
     login_manager_observation_.Reset();
   }
   Resume();
 }
+
+}  // namespace ash
diff --git a/chrome/browser/ash/login/signin/merge_session_navigation_throttle.h b/chrome/browser/ash/login/signin/merge_session_navigation_throttle.h
index 087c285..97e5f0c6a 100644
--- a/chrome/browser/ash/login/signin/merge_session_navigation_throttle.h
+++ b/chrome/browser/ash/login/signin/merge_session_navigation_throttle.h
@@ -18,13 +18,14 @@
 class NavigationHandle;
 }
 
+namespace ash {
+
 // Used to delay a navigation while merge session process (cookie
 // reconstruction from OAuth2 refresh token in ChromeOS login) is still in
 // progress while we are attempting to load a google property. It will resume
 // the navigation once merge session is done, or after 10 seconds.
-class MergeSessionNavigationThrottle
-    : public content::NavigationThrottle,
-      public chromeos::OAuth2LoginManager::Observer {
+class MergeSessionNavigationThrottle : public content::NavigationThrottle,
+                                       public OAuth2LoginManager::Observer {
  public:
   static std::unique_ptr<content::NavigationThrottle> Create(
       content::NavigationHandle* handle);
@@ -42,7 +43,7 @@
   // OAuth2LoginManager::Observer implementation:
   void OnSessionRestoreStateChanged(
       Profile* user_profile,
-      chromeos::OAuth2LoginManager::SessionRestoreState state) override;
+      OAuth2LoginManager::SessionRestoreState state) override;
 
   // Sets up timer and OAuth2LoginManager Observer, should be called before
   // deferring. Returns true if the Observer was set up correctly and the
@@ -53,8 +54,7 @@
   // navigation.
   void Proceed();
 
-  base::ScopedObservation<chromeos::OAuth2LoginManager,
-                          chromeos::OAuth2LoginManager::Observer>
+  base::ScopedObservation<OAuth2LoginManager, OAuth2LoginManager::Observer>
       login_manager_observation_{this};
 
   base::OneShotTimer proceed_timer_;
@@ -62,4 +62,6 @@
   DISALLOW_COPY_AND_ASSIGN(MergeSessionNavigationThrottle);
 };
 
+}  // namespace ash
+
 #endif  // CHROME_BROWSER_ASH_LOGIN_SIGNIN_MERGE_SESSION_NAVIGATION_THROTTLE_H_
diff --git a/chrome/browser/ash/login/signin/merge_session_throttling_utils.cc b/chrome/browser/ash/login/signin/merge_session_throttling_utils.cc
index 331fdea..199617f 100644
--- a/chrome/browser/ash/login/signin/merge_session_throttling_utils.cc
+++ b/chrome/browser/ash/login/signin/merge_session_throttling_utils.cc
@@ -23,13 +23,13 @@
 #include "services/network/public/cpp/network_connection_tracker.h"
 #include "url/gurl.h"
 
-using content::BrowserThread;
-using content::WebContents;
-
+namespace ash {
 namespace merge_session_throttling_utils {
-
 namespace {
 
+using ::content::BrowserThread;
+using ::content::WebContents;
+
 const int64_t kMaxSessionRestoreTimeInSec = 60;
 
 // The set of blocked profiles.
@@ -125,14 +125,13 @@
   if (!profile)
     return false;
 
-  chromeos::OAuth2LoginManager* login_manager =
-      chromeos::OAuth2LoginManagerFactory::GetInstance()->GetForProfile(
-          profile);
+  auto* login_manager =
+      OAuth2LoginManagerFactory::GetInstance()->GetForProfile(profile);
   if (!login_manager)
     return false;
 
   switch (login_manager->state()) {
-    case chromeos::OAuth2LoginManager::SESSION_RESTORE_NOT_STARTED:
+    case OAuth2LoginManager::SESSION_RESTORE_NOT_STARTED:
       // The session restore for this profile hasn't even started yet. Don't
       // block for now.
       // In theory this should not happen since we should
@@ -144,8 +143,8 @@
                      << "session restore?";
       }
       return false;
-    case chromeos::OAuth2LoginManager::SESSION_RESTORE_PREPARING:
-    case chromeos::OAuth2LoginManager::SESSION_RESTORE_IN_PROGRESS: {
+    case OAuth2LoginManager::SESSION_RESTORE_PREPARING:
+    case OAuth2LoginManager::SESSION_RESTORE_IN_PROGRESS: {
       // Check if the session restore has been going on for a while already.
       // If so, don't attempt to block page loading.
       if ((base::Time::Now() - login_manager->session_restore_start())
@@ -159,9 +158,9 @@
       BlockProfile(profile);
       return true;
     }
-    case chromeos::OAuth2LoginManager::SESSION_RESTORE_DONE:
-    case chromeos::OAuth2LoginManager::SESSION_RESTORE_FAILED:
-    case chromeos::OAuth2LoginManager::SESSION_RESTORE_CONNECTION_FAILED: {
+    case OAuth2LoginManager::SESSION_RESTORE_DONE:
+    case OAuth2LoginManager::SESSION_RESTORE_FAILED:
+    case OAuth2LoginManager::SESSION_RESTORE_CONNECTION_FAILED: {
       UnblockProfile(profile);
       return false;
     }
@@ -193,14 +192,13 @@
   if (!profile)
     return false;
 
-  chromeos::OAuth2LoginManager* login_manager =
-      chromeos::OAuth2LoginManagerFactory::GetInstance()->GetForProfile(
-          profile);
+  auto* login_manager =
+      OAuth2LoginManagerFactory::GetInstance()->GetForProfile(profile);
   bool pending_session_restore = false;
   if (login_manager) {
     switch (login_manager->state()) {
-      case chromeos::OAuth2LoginManager::SESSION_RESTORE_PREPARING:
-      case chromeos::OAuth2LoginManager::SESSION_RESTORE_IN_PROGRESS:
+      case OAuth2LoginManager::SESSION_RESTORE_PREPARING:
+      case OAuth2LoginManager::SESSION_RESTORE_IN_PROGRESS:
         pending_session_restore = true;
         break;
 
@@ -213,3 +211,4 @@
 }
 
 }  // namespace merge_session_throttling_utils
+}  // namespace ash
diff --git a/chrome/browser/ash/login/signin/merge_session_throttling_utils.h b/chrome/browser/ash/login/signin/merge_session_throttling_utils.h
index 90ba62d..401a288 100644
--- a/chrome/browser/ash/login/signin/merge_session_throttling_utils.h
+++ b/chrome/browser/ash/login/signin/merge_session_throttling_utils.h
@@ -12,11 +12,13 @@
 class WebContents;
 }
 
+namespace ash {
+namespace merge_session_throttling_utils {
+
 // A set of helper functions used by the MergeSessionNavigationThrottle and the
 // RendererUpdater to determine if an interstitial page should be
 // shown for a request when the merge session process (cookie reconstruction
 // from OAuth2 refresh token in ChromeOS login) is still in progress.
-namespace merge_session_throttling_utils {
 
 // Policy for when it is valid to attach a MergeSessionNavigationThrottle.
 // Namely, this will be false for unit tests, where the UserManager is not
@@ -44,5 +46,6 @@
 bool IsSessionRestorePending(Profile* profile);
 
 }  // namespace merge_session_throttling_utils
+}  // namespace ash
 
 #endif  // CHROME_BROWSER_ASH_LOGIN_SIGNIN_MERGE_SESSION_THROTTLING_UTILS_H_
diff --git a/chrome/browser/ash/login/signin/oauth2_browsertest.cc b/chrome/browser/ash/login/signin/oauth2_browsertest.cc
index 6472385..f44ad6b 100644
--- a/chrome/browser/ash/login/signin/oauth2_browsertest.cc
+++ b/chrome/browser/ash/login/signin/oauth2_browsertest.cc
@@ -69,15 +69,14 @@
 #include "net/test/embedded_test_server/http_response.h"
 #include "third_party/abseil-cpp/absl/types/optional.h"
 
-using net::test_server::BasicHttpResponse;
-using net::test_server::HttpRequest;
-using net::test_server::HttpResponse;
-using net::test_server::HungResponse;
-
-namespace chromeos {
-
+namespace ash {
 namespace {
 
+using ::net::test_server::BasicHttpResponse;
+using ::net::test_server::HttpRequest;
+using ::net::test_server::HttpResponse;
+using ::net::test_server::HungResponse;
+
 // Email of owner account for test.
 const char kTestGaiaId[] = "12345";
 const char kTestEmail[] = "[email protected]";
@@ -310,8 +309,8 @@
     // Try login.  Primary profile has changed.
     AccountId account_id =
         AccountId::FromUserEmailGaiaId(kTestEmail, kTestGaiaId);
-    ash::LoginScreenTestApi::SubmitPassword(account_id, kTestAccountPassword,
-                                            true /*check_if_submittable */);
+    LoginScreenTestApi::SubmitPassword(account_id, kTestAccountPassword,
+                                       true /*check_if_submittable */);
     test::WaitForPrimaryUserSessionStart();
     Profile* profile = ProfileManager::GetPrimaryUserProfile();
 
@@ -567,7 +566,7 @@
 IN_PROC_BROWSER_TEST_F(OAuth2Test, MergeSession) {
   SimulateNetworkOnline();
 
-  EXPECT_EQ(1, ash::LoginScreenTestApi::GetUsersCount());
+  EXPECT_EQ(1, LoginScreenTestApi::GetUsersCount());
 
   // PickAccountId does not work at this point as the primary user profile has
   // not yet been created.
@@ -1224,4 +1223,4 @@
 
 INSTANTIATE_TEST_SUITE_P(All, MergeSessionTimeoutTest, testing::Bool());
 
-}  // namespace chromeos
+}  // namespace ash
diff --git a/chrome/browser/ash/login/signin/oauth2_login_manager.cc b/chrome/browser/ash/login/signin/oauth2_login_manager.cc
index 0286945b..7e3ca1c 100644
--- a/chrome/browser/ash/login/signin/oauth2_login_manager.cc
+++ b/chrome/browser/ash/login/signin/oauth2_login_manager.cc
@@ -22,7 +22,7 @@
 #include "google_apis/gaia/gaia_auth_util.h"
 #include "google_apis/gaia/gaia_urls.h"
 
-namespace chromeos {
+namespace ash {
 
 OAuth2LoginManager::OAuth2LoginManager(Profile* user_profile)
     : user_profile_(user_profile),
@@ -32,7 +32,7 @@
   // For telemetry, we mark session restore completed to avoid warnings from
   // MergeSessionThrottle.
   if (base::CommandLine::ForCurrentProcess()->HasSwitch(
-          chromeos::switches::kDisableGaiaServices)) {
+          switches::kDisableGaiaServices)) {
     SetSessionRestoreState(SESSION_RESTORE_DONE);
   }
 }
@@ -276,4 +276,4 @@
   session_restore_start_ = time;
 }
 
-}  // namespace chromeos
+}  // namespace ash
diff --git a/chrome/browser/ash/login/signin/oauth2_login_manager.h b/chrome/browser/ash/login/signin/oauth2_login_manager.h
index 1392fa5b..9625255 100644
--- a/chrome/browser/ash/login/signin/oauth2_login_manager.h
+++ b/chrome/browser/ash/login/signin/oauth2_login_manager.h
@@ -20,7 +20,7 @@
 class GoogleServiceAuthError;
 class Profile;
 
-namespace chromeos {
+namespace ash {
 
 // This class is responsible for restoring authenticated web sessions out of
 // OAuth2 refresh tokens or pre-authenticated cookie jar.
@@ -192,12 +192,12 @@
   DISALLOW_COPY_AND_ASSIGN(OAuth2LoginManager);
 };
 
-}  // namespace chromeos
+}  // namespace ash
 
 // TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos
 // source migration is finished.
-namespace ash {
-using ::chromeos::OAuth2LoginManager;
-}  // namespace ash
+namespace chromeos {
+using ::ash::OAuth2LoginManager;
+}
 
 #endif  // CHROME_BROWSER_ASH_LOGIN_SIGNIN_OAUTH2_LOGIN_MANAGER_H_
diff --git a/chrome/browser/ash/login/signin/oauth2_login_manager_factory.cc b/chrome/browser/ash/login/signin/oauth2_login_manager_factory.cc
index f4b9643..5a2f5f16 100644
--- a/chrome/browser/ash/login/signin/oauth2_login_manager_factory.cc
+++ b/chrome/browser/ash/login/signin/oauth2_login_manager_factory.cc
@@ -9,7 +9,7 @@
 #include "chrome/browser/signin/identity_manager_factory.h"
 #include "components/keyed_service/content/browser_context_dependency_manager.h"
 
-namespace chromeos {
+namespace ash {
 
 OAuth2LoginManagerFactory::OAuth2LoginManagerFactory()
     : BrowserContextKeyedServiceFactory(
@@ -39,4 +39,4 @@
   return service;
 }
 
-}  // namespace chromeos
+}  // namespace ash
diff --git a/chrome/browser/ash/login/signin/oauth2_login_manager_factory.h b/chrome/browser/ash/login/signin/oauth2_login_manager_factory.h
index 568c584..3739203 100644
--- a/chrome/browser/ash/login/signin/oauth2_login_manager_factory.h
+++ b/chrome/browser/ash/login/signin/oauth2_login_manager_factory.h
@@ -11,7 +11,7 @@
 
 class Profile;
 
-namespace chromeos {
+namespace ash {
 
 class OAuth2LoginManager;
 
@@ -40,12 +40,12 @@
   DISALLOW_COPY_AND_ASSIGN(OAuth2LoginManagerFactory);
 };
 
-}  // namespace chromeos
+}  // namespace ash
 
 // TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos
 // source migration is finished.
-namespace ash {
-using ::chromeos::OAuth2LoginManagerFactory;
+namespace chromeos {
+using ::ash::OAuth2LoginManagerFactory;
 }
 
 #endif  // CHROME_BROWSER_ASH_LOGIN_SIGNIN_OAUTH2_LOGIN_MANAGER_FACTORY_H_
diff --git a/chrome/browser/ash/login/signin/oauth2_login_verifier.cc b/chrome/browser/ash/login/signin/oauth2_login_verifier.cc
index 6ceef876..731f6e9 100644
--- a/chrome/browser/ash/login/signin/oauth2_login_verifier.cc
+++ b/chrome/browser/ash/login/signin/oauth2_login_verifier.cc
@@ -12,9 +12,9 @@
 #include "content/public/browser/browser_thread.h"
 #include "google_apis/gaia/gaia_auth_util.h"
 
-using content::BrowserThread;
+namespace ash {
 
-namespace chromeos {
+using ::content::BrowserThread;
 
 OAuth2LoginVerifier::OAuth2LoginVerifier(
     OAuth2LoginVerifier::Delegate* delegate,
@@ -97,4 +97,4 @@
   delegate_->OnListAccountsFailure(error.IsTransientError());
 }
 
-}  // namespace chromeos
+}  // namespace ash
diff --git a/chrome/browser/ash/login/signin/oauth2_login_verifier.h b/chrome/browser/ash/login/signin/oauth2_login_verifier.h
index 286479a..48fe9aab 100644
--- a/chrome/browser/ash/login/signin/oauth2_login_verifier.h
+++ b/chrome/browser/ash/login/signin/oauth2_login_verifier.h
@@ -15,7 +15,7 @@
 #include "chrome/browser/profiles/profile.h"
 #include "components/signin/public/identity_manager/identity_manager.h"
 
-namespace chromeos {
+namespace ash {
 
 // Given GCMS and primary account id, this class verifies GAIA credentials
 // (SAPISID) and rebuild current session's cookie jar for the primary account.
@@ -71,6 +71,6 @@
   DISALLOW_COPY_AND_ASSIGN(OAuth2LoginVerifier);
 };
 
-}  // namespace chromeos
+}  // namespace ash
 
 #endif  // CHROME_BROWSER_ASH_LOGIN_SIGNIN_OAUTH2_LOGIN_VERIFIER_H_
diff --git a/chrome/browser/ash/login/signin/oauth2_token_fetcher.cc b/chrome/browser/ash/login/signin/oauth2_token_fetcher.cc
index 3d04e11..c74edad 100644
--- a/chrome/browser/ash/login/signin/oauth2_token_fetcher.cc
+++ b/chrome/browser/ash/login/signin/oauth2_token_fetcher.cc
@@ -16,10 +16,11 @@
 #include "services/network/public/cpp/shared_url_loader_factory.h"
 #include "third_party/cros_system_api/dbus/service_constants.h"
 
-using content::BrowserThread;
-
+namespace ash {
 namespace {
 
+using ::content::BrowserThread;
+
 // OAuth token request max retry count.
 const int kMaxRequestAttemptCount = 5;
 // OAuth token request retry delay in milliseconds.
@@ -27,8 +28,6 @@
 
 }  // namespace
 
-namespace chromeos {
-
 OAuth2TokenFetcher::OAuth2TokenFetcher(
     OAuth2TokenFetcher::Delegate* delegate,
     scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory)
@@ -87,4 +86,4 @@
   std::move(error_handler).Run();
 }
 
-}  // namespace chromeos
+}  // namespace ash
diff --git a/chrome/browser/ash/login/signin/oauth2_token_fetcher.h b/chrome/browser/ash/login/signin/oauth2_token_fetcher.h
index 6263145..d0680ba6 100644
--- a/chrome/browser/ash/login/signin/oauth2_token_fetcher.h
+++ b/chrome/browser/ash/login/signin/oauth2_token_fetcher.h
@@ -19,7 +19,7 @@
 class SharedURLLoaderFactory;
 }
 
-namespace chromeos {
+namespace ash {
 
 // OAuth2TokenFetcher is used to convert authenticated cookie jar from the
 // authentication profile into OAuth2 tokens and GAIA credentials that will be
@@ -69,6 +69,6 @@
   DISALLOW_COPY_AND_ASSIGN(OAuth2TokenFetcher);
 };
 
-}  // namespace chromeos
+}  // namespace ash
 
 #endif  // CHROME_BROWSER_ASH_LOGIN_SIGNIN_OAUTH2_TOKEN_FETCHER_H_
diff --git a/chrome/browser/ash/login/signin/oauth2_token_initializer.cc b/chrome/browser/ash/login/signin/oauth2_token_initializer.cc
index eba9d72..5b2d5004 100644
--- a/chrome/browser/ash/login/signin/oauth2_token_initializer.cc
+++ b/chrome/browser/ash/login/signin/oauth2_token_initializer.cc
@@ -11,7 +11,7 @@
 #include "chrome/common/chrome_features.h"
 #include "services/network/public/cpp/shared_url_loader_factory.h"
 
-namespace chromeos {
+namespace ash {
 
 OAuth2TokenInitializer::OAuth2TokenInitializer() {}
 
@@ -57,4 +57,4 @@
   std::move(callback_).Run(false, user_context_);
 }
 
-}  // namespace chromeos
+}  // namespace ash
diff --git a/chrome/browser/ash/login/signin/oauth2_token_initializer.h b/chrome/browser/ash/login/signin/oauth2_token_initializer.h
index 85f607d4..7b0097c0 100644
--- a/chrome/browser/ash/login/signin/oauth2_token_initializer.h
+++ b/chrome/browser/ash/login/signin/oauth2_token_initializer.h
@@ -12,7 +12,7 @@
 #include "chrome/browser/ash/login/signin/oauth2_token_fetcher.h"
 #include "chromeos/login/auth/user_context.h"
 
-namespace chromeos {
+namespace ash {
 
 // Performs initial fetch of OAuth2 Tokens.
 class OAuth2TokenInitializer final : public OAuth2TokenFetcher::Delegate {
@@ -40,6 +40,12 @@
   DISALLOW_COPY_AND_ASSIGN(OAuth2TokenInitializer);
 };
 
-}  // namespace chromeos
+}  // namespace ash
+
+// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos
+// source migration is finished.
+namespace chromeos {
+using ::ash::OAuth2TokenInitializer;
+}
 
 #endif  // CHROME_BROWSER_ASH_LOGIN_SIGNIN_OAUTH2_TOKEN_INITIALIZER_H_
diff --git a/chrome/browser/ash/login/signin/offline_signin_limiter.cc b/chrome/browser/ash/login/signin/offline_signin_limiter.cc
index a19c996..37c8c8b6 100644
--- a/chrome/browser/ash/login/signin/offline_signin_limiter.cc
+++ b/chrome/browser/ash/login/signin/offline_signin_limiter.cc
@@ -31,7 +31,7 @@
 #include "components/user_manager/user.h"
 #include "components/user_manager/user_manager.h"
 
-namespace chromeos {
+namespace ash {
 
 void OfflineSigninLimiter::SignedIn(UserContext::AuthFlow auth_flow) {
   PrefService* prefs = profile_->GetPrefs();
@@ -415,4 +415,4 @@
   user_manager::known_user::SetOfflineSigninLimit(user->GetAccountId(), limit);
 }
 
-}  // namespace chromeos
+}  // namespace ash
diff --git a/chrome/browser/ash/login/signin/offline_signin_limiter.h b/chrome/browser/ash/login/signin/offline_signin_limiter.h
index 80f72b06..b8fce231 100644
--- a/chrome/browser/ash/login/signin/offline_signin_limiter.h
+++ b/chrome/browser/ash/login/signin/offline_signin_limiter.h
@@ -22,7 +22,7 @@
 class Clock;
 }
 
-namespace chromeos {
+namespace ash {
 
 // Enforces a limit on the length of time for which a user authenticated via
 // Gaia without SAML or with SAML can use offline authentication against a
@@ -97,12 +97,6 @@
   DISALLOW_COPY_AND_ASSIGN(OfflineSigninLimiter);
 };
 
-}  // namespace chromeos
-
-// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos
-// source migration is finished.
-namespace ash {
-using ::chromeos::OfflineSigninLimiter;
-}
+}  // namespace ash
 
 #endif  // CHROME_BROWSER_ASH_LOGIN_SIGNIN_OFFLINE_SIGNIN_LIMITER_H_
diff --git a/chrome/browser/ash/login/signin/offline_signin_limiter_factory.cc b/chrome/browser/ash/login/signin/offline_signin_limiter_factory.cc
index 8cfc9c37..c2fb6ff4 100644
--- a/chrome/browser/ash/login/signin/offline_signin_limiter_factory.cc
+++ b/chrome/browser/ash/login/signin/offline_signin_limiter_factory.cc
@@ -11,7 +11,7 @@
 #include "components/keyed_service/core/keyed_service.h"
 #include "content/public/browser/browser_context.h"
 
-namespace chromeos {
+namespace ash {
 
 base::Clock* OfflineSigninLimiterFactory::clock_for_testing_ = NULL;
 
@@ -45,4 +45,4 @@
                                   clock_for_testing_);
 }
 
-}  // namespace chromeos
+}  // namespace ash
diff --git a/chrome/browser/ash/login/signin/offline_signin_limiter_factory.h b/chrome/browser/ash/login/signin/offline_signin_limiter_factory.h
index 19b0556..4b3b3d9 100644
--- a/chrome/browser/ash/login/signin/offline_signin_limiter_factory.h
+++ b/chrome/browser/ash/login/signin/offline_signin_limiter_factory.h
@@ -16,7 +16,7 @@
 class Clock;
 }
 
-namespace chromeos {
+namespace ash {
 
 class OfflineSigninLimiter;
 
@@ -47,12 +47,6 @@
   DISALLOW_COPY_AND_ASSIGN(OfflineSigninLimiterFactory);
 };
 
-}  // namespace chromeos
-
-// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos
-// source migration is finished.
-namespace ash {
-using ::chromeos::OfflineSigninLimiterFactory;
-}
+}  // namespace ash
 
 #endif  // CHROME_BROWSER_ASH_LOGIN_SIGNIN_OFFLINE_SIGNIN_LIMITER_FACTORY_H_
diff --git a/chrome/browser/ash/login/signin/offline_signin_limiter_unittest.cc b/chrome/browser/ash/login/signin/offline_signin_limiter_unittest.cc
index 890f23d..ddc9719 100644
--- a/chrome/browser/ash/login/signin/offline_signin_limiter_unittest.cc
+++ b/chrome/browser/ash/login/signin/offline_signin_limiter_unittest.cc
@@ -30,15 +30,14 @@
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-using testing::_;
-using testing::Mock;
-using testing::Return;
-using testing::Sequence;
-
-namespace chromeos {
-
+namespace ash {
 namespace {
 
+using ::testing::_;
+using ::testing::Mock;
+using ::testing::Return;
+using ::testing::Sequence;
+
 const char kTestGaiaUser[] = "[email protected]";
 const char kTestSAMLUser[] = "[email protected]";
 
@@ -1356,4 +1355,4 @@
   EXPECT_FALSE(timer_->IsRunning());
 }
 
-}  //  namespace chromeos
+}  //  namespace ash
diff --git a/chrome/browser/ash/login/signin/signin_error_notifier_ash.cc b/chrome/browser/ash/login/signin/signin_error_notifier.cc
similarity index 95%
rename from chrome/browser/ash/login/signin/signin_error_notifier_ash.cc
rename to chrome/browser/ash/login/signin/signin_error_notifier.cc
index fc80dfb..65900a12 100644
--- a/chrome/browser/ash/login/signin/signin_error_notifier_ash.cc
+++ b/chrome/browser/ash/login/signin/signin_error_notifier.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "chrome/browser/ash/login/signin/signin_error_notifier_ash.h"
+#include "chrome/browser/ash/login/signin/signin_error_notifier.h"
 
 #include <memory>
 #include <string>
@@ -53,6 +53,7 @@
 #include "ui/message_center/public/cpp/notification.h"
 #include "ui/message_center/public/cpp/notification_delegate.h"
 
+namespace ash {
 namespace {
 
 constexpr char kProfileSigninNotificationId[] = "chrome://settings/signin/";
@@ -128,7 +129,7 @@
     TokenHandleUtil::TokenHandleStatus status) {
   if (status != TokenHandleUtil::INVALID)
     return;
-  RecordReauthReason(account_id, chromeos::ReauthReason::INVALID_TOKEN_HANDLE);
+  RecordReauthReason(account_id, ReauthReason::INVALID_TOKEN_HANDLE);
   HandleDeviceAccountError();
 }
 
@@ -170,10 +171,10 @@
 
   const AccountId account_id =
       multi_user_util::GetAccountIdFromProfile(profile_);
-  if (!ash::IsAccountManagerAvailable(profile_)) {
+  if (!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);
+    RecordReauthReason(account_id, ReauthReason::SYNC_FAILED);
     HandleDeviceAccountError();
     return;
   }
@@ -182,7 +183,7 @@
   const CoreAccountId primary_account_id =
       identity_manager_->GetPrimaryAccountId(signin::ConsentLevel::kSignin);
   if (error_account_id == primary_account_id) {
-    RecordReauthReason(account_id, chromeos::ReauthReason::SYNC_FAILED);
+    RecordReauthReason(account_id, ReauthReason::SYNC_FAILED);
     HandleDeviceAccountError();
   } else {
     HandleSecondaryAccountError(error_account_id);
@@ -219,7 +220,7 @@
       multi_user_util::GetAccountIdFromProfile(profile_).GetUserEmail();
 
   std::unique_ptr<message_center::Notification> notification =
-      ash::CreateSystemNotification(
+      CreateSystemNotification(
           message_center::NOTIFICATION_TYPE_SIMPLE,
           device_account_notification_id_,
           l10n_util::GetStringUTF16(IDS_SIGNIN_ERROR_BUBBLE_VIEW_TITLE),
@@ -275,7 +276,7 @@
                 IDS_SIGNIN_ERROR_SECONDARY_ACCOUNT_MIGRATION_BUBBLE_VIEW_MESSAGE);
 
   std::unique_ptr<message_center::Notification> notification =
-      ash::CreateSystemNotification(
+      CreateSystemNotification(
           message_center::NOTIFICATION_TYPE_SIMPLE,
           secondary_account_notification_id_, message_title, message_body,
           l10n_util::GetStringUTF16(
@@ -301,15 +302,14 @@
     absl::optional<int> button_index) {
   if (profile_->IsChild() && !profile_->GetPrefs()->GetBoolean(
                                  prefs::kEduCoexistenceArcMigrationCompleted)) {
-    if (!chromeos::AccountManagerWelcomeDialog::
-            ShowIfRequiredForEduCoexistence()) {
+    if (!AccountManagerWelcomeDialog::ShowIfRequiredForEduCoexistence()) {
       chrome::SettingsWindowManager::GetInstance()->ShowOSSettings(
           profile_, chromeos::settings::mojom::kMyAccountsSubpagePath);
     }
     return;
   }
 
-  if (!chromeos::AccountManagerWelcomeDialog::ShowIfRequired()) {
+  if (!AccountManagerWelcomeDialog::ShowIfRequired()) {
     // The welcome dialog was not shown (because it has been shown too many
     // times already). Take users to Account Manager UI directly.
     // Note: If the welcome dialog was shown, we don't need to do anything.
@@ -349,3 +349,5 @@
           IDS_SYNC_OTHER_SIGN_IN_ERROR_BUBBLE_VIEW_MESSAGE);
   }
 }
+
+}  // namespace ash
diff --git a/chrome/browser/ash/login/signin/signin_error_notifier_ash.h b/chrome/browser/ash/login/signin/signin_error_notifier.h
similarity index 90%
rename from chrome/browser/ash/login/signin/signin_error_notifier_ash.h
rename to chrome/browser/ash/login/signin/signin_error_notifier.h
index 4930bd5..423ea0f7 100644
--- a/chrome/browser/ash/login/signin/signin_error_notifier_ash.h
+++ b/chrome/browser/ash/login/signin/signin_error_notifier.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CHROME_BROWSER_ASH_LOGIN_SIGNIN_SIGNIN_ERROR_NOTIFIER_ASH_H_
-#define CHROME_BROWSER_ASH_LOGIN_SIGNIN_SIGNIN_ERROR_NOTIFIER_ASH_H_
+#ifndef CHROME_BROWSER_ASH_LOGIN_SIGNIN_SIGNIN_ERROR_NOTIFIER_H_
+#define CHROME_BROWSER_ASH_LOGIN_SIGNIN_SIGNIN_ERROR_NOTIFIER_H_
 
 #include <string>
 #include <vector>
@@ -21,14 +21,13 @@
 class Profile;
 class PrefRegistrySimple;
 
-namespace ash {
-class AccountManager;
-}
-
 namespace signin {
 class IdentityManager;
 }  // namespace signin.
 
+namespace ash {
+class AccountManager;
+
 // Shows signin-related errors as notifications in Ash.
 class SigninErrorNotifier : public SigninErrorController::Observer,
                             public KeyedService {
@@ -95,4 +94,12 @@
   DISALLOW_COPY_AND_ASSIGN(SigninErrorNotifier);
 };
 
-#endif  // CHROME_BROWSER_ASH_LOGIN_SIGNIN_SIGNIN_ERROR_NOTIFIER_ASH_H_
+}  // namespace ash
+
+// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos
+// source migration is finished.
+namespace chromeos {
+using ::ash::SigninErrorNotifier;
+}
+
+#endif  // CHROME_BROWSER_ASH_LOGIN_SIGNIN_SIGNIN_ERROR_NOTIFIER_H_
diff --git a/chrome/browser/ash/login/signin/signin_error_notifier_factory_ash.cc b/chrome/browser/ash/login/signin/signin_error_notifier_factory.cc
similarity index 91%
rename from chrome/browser/ash/login/signin/signin_error_notifier_factory_ash.cc
rename to chrome/browser/ash/login/signin/signin_error_notifier_factory.cc
index 4afb5b50..6f2e9289 100644
--- a/chrome/browser/ash/login/signin/signin_error_notifier_factory_ash.cc
+++ b/chrome/browser/ash/login/signin/signin_error_notifier_factory.cc
@@ -2,16 +2,18 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "chrome/browser/ash/login/signin/signin_error_notifier_factory_ash.h"
+#include "chrome/browser/ash/login/signin/signin_error_notifier_factory.h"
 
 #include "ash/constants/ash_switches.h"
-#include "chrome/browser/ash/login/signin/signin_error_notifier_ash.h"
+#include "chrome/browser/ash/login/signin/signin_error_notifier.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/notifications/notification_display_service_factory.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/signin/signin_error_controller_factory.h"
 #include "components/keyed_service/content/browser_context_dependency_manager.h"
 
+namespace ash {
+
 SigninErrorNotifierFactory::SigninErrorNotifierFactory()
     : BrowserContextKeyedServiceFactory(
           "SigninErrorNotifier",
@@ -37,10 +39,12 @@
 KeyedService* SigninErrorNotifierFactory::BuildServiceInstanceFor(
     content::BrowserContext* context) const {
   // If this is during dummy login from tests, suppress the notification.
-  if (chromeos::switches::IsGaiaServicesDisabled())
+  if (switches::IsGaiaServicesDisabled())
     return nullptr;
 
   Profile* profile = static_cast<Profile*>(context);
   return new SigninErrorNotifier(
       SigninErrorControllerFactory::GetForProfile(profile), profile);
 }
+
+}  // namespace ash
diff --git a/chrome/browser/ash/login/signin/signin_error_notifier_factory_ash.h b/chrome/browser/ash/login/signin/signin_error_notifier_factory.h
similarity index 95%
rename from chrome/browser/ash/login/signin/signin_error_notifier_factory_ash.h
rename to chrome/browser/ash/login/signin/signin_error_notifier_factory.h
index 7b96192..ea6b8c7 100644
--- a/chrome/browser/ash/login/signin/signin_error_notifier_factory_ash.h
+++ b/chrome/browser/ash/login/signin/signin_error_notifier_factory.h
@@ -2,16 +2,18 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CHROME_BROWSER_ASH_LOGIN_SIGNIN_SIGNIN_ERROR_NOTIFIER_FACTORY_ASH_H_
-#define CHROME_BROWSER_ASH_LOGIN_SIGNIN_SIGNIN_ERROR_NOTIFIER_FACTORY_ASH_H_
+#ifndef CHROME_BROWSER_ASH_LOGIN_SIGNIN_SIGNIN_ERROR_NOTIFIER_FACTORY_H_
+#define CHROME_BROWSER_ASH_LOGIN_SIGNIN_SIGNIN_ERROR_NOTIFIER_FACTORY_H_
 
 #include "base/macros.h"
 #include "base/memory/singleton.h"
 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
 
-class SigninErrorNotifier;
 class Profile;
 
+namespace ash {
+class SigninErrorNotifier;
+
 // Singleton that owns all SigninErrorNotifiers and associates them with
 // Profiles. Listens for the Profile's destruction notification and cleans up
 // the associated SigninErrorNotifier.
@@ -37,4 +39,6 @@
   DISALLOW_COPY_AND_ASSIGN(SigninErrorNotifierFactory);
 };
 
-#endif  // CHROME_BROWSER_ASH_LOGIN_SIGNIN_SIGNIN_ERROR_NOTIFIER_FACTORY_ASH_H_
+}  // namespace ash
+
+#endif  // CHROME_BROWSER_ASH_LOGIN_SIGNIN_SIGNIN_ERROR_NOTIFIER_FACTORY_H_
diff --git a/chrome/browser/ash/login/signin/signin_error_notifier_ash_unittest.cc b/chrome/browser/ash/login/signin/signin_error_notifier_unittest.cc
similarity index 97%
rename from chrome/browser/ash/login/signin/signin_error_notifier_ash_unittest.cc
rename to chrome/browser/ash/login/signin/signin_error_notifier_unittest.cc
index c0220709..64f2ca4 100644
--- a/chrome/browser/ash/login/signin/signin_error_notifier_ash_unittest.cc
+++ b/chrome/browser/ash/login/signin/signin_error_notifier_unittest.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "chrome/browser/ash/login/signin/signin_error_notifier_ash.h"
+#include "chrome/browser/ash/login/signin/signin_error_notifier.h"
 
 #include <stddef.h>
 
@@ -12,7 +12,7 @@
 #include "base/cxx17_backports.h"
 #include "base/memory/ptr_util.h"
 #include "build/build_config.h"
-#include "chrome/browser/ash/login/signin/signin_error_notifier_factory_ash.h"
+#include "chrome/browser/ash/login/signin/signin_error_notifier_factory.h"
 #include "chrome/browser/ash/login/users/mock_user_manager.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/notifications/notification_display_service_tester.h"
@@ -30,6 +30,7 @@
 #include "testing/gtest/include/gtest/gtest.h"
 #include "ui/message_center/public/cpp/notification.h"
 
+namespace ash {
 namespace {
 
 const char kTestEmail[] = "[email protected]";
@@ -47,7 +48,7 @@
   void SetUp() override {
     BrowserWithTestWindowTest::SetUp();
 
-    mock_user_manager_ = new ash::MockUserManager();
+    mock_user_manager_ = new MockUserManager();
     user_manager_enabler_ = std::make_unique<user_manager::ScopedUserManager>(
         base::WrapUnique(mock_user_manager_));
 
@@ -84,7 +85,7 @@
 
  protected:
   std::unique_ptr<NotificationDisplayServiceTester> display_service_;
-  ash::MockUserManager* mock_user_manager_;  // Not owned.
+  MockUserManager* mock_user_manager_;  // Not owned.
   std::unique_ptr<user_manager::ScopedUserManager> user_manager_enabler_;
   std::unique_ptr<IdentityTestEnvironmentProfileAdaptor>
       identity_test_env_profile_adaptor_;
@@ -292,3 +293,4 @@
 }
 
 }  // namespace
+}  // namespace ash
diff --git a/chrome/browser/ash/login/signin/token_handle_fetcher.cc b/chrome/browser/ash/login/signin/token_handle_fetcher.cc
index 880f413..e37b205 100644
--- a/chrome/browser/ash/login/signin/token_handle_fetcher.cc
+++ b/chrome/browser/ash/login/signin/token_handle_fetcher.cc
@@ -22,7 +22,9 @@
 #include "google_apis/gaia/gaia_constants.h"
 #include "services/network/public/cpp/shared_url_loader_factory.h"
 
+namespace ash {
 namespace {
+
 const int kMaxRetries = 3;
 const char kAccessTokenFetchId[] = "token_handle_fetcher";
 
@@ -109,7 +111,7 @@
 
 void TokenHandleFetcher::FillForNewUser(const std::string& access_token,
                                         TokenFetchingCallback callback) {
-  profile_ = chromeos::ProfileHelper::Get()->GetSigninProfile();
+  profile_ = ProfileHelper::Get()->GetSigninProfile();
   callback_ = std::move(callback);
   FillForAccessToken(access_token);
 }
@@ -149,3 +151,5 @@
 void TokenHandleFetcher::OnProfileDestroyed() {
   std::move(callback_).Run(account_id_, false);
 }
+
+}  // namespace ash
diff --git a/chrome/browser/ash/login/signin/token_handle_fetcher.h b/chrome/browser/ash/login/signin/token_handle_fetcher.h
index 6d76e24..abd844e 100644
--- a/chrome/browser/ash/login/signin/token_handle_fetcher.h
+++ b/chrome/browser/ash/login/signin/token_handle_fetcher.h
@@ -16,18 +16,19 @@
 #include "components/signin/public/identity_manager/primary_account_access_token_fetcher.h"
 #include "google_apis/gaia/gaia_oauth_client.h"
 
+class Profile;
+
 namespace signin {
 class IdentityManager;
 }
 
+namespace ash {
 class TokenHandleUtil;
-class Profile;
 
 // This class is resposible for obtaining new token handle for user.
 // It can be used in two ways. When user have just used GAIA signin there is
 // an OAuth2 token available. If there is profile already loaded, then
 // minting additional access token might be required.
-
 class TokenHandleFetcher : public gaia::GaiaOAuthClient::Delegate {
  public:
   TokenHandleFetcher(TokenHandleUtil* util, const AccountId& account_id);
@@ -75,4 +76,6 @@
   DISALLOW_COPY_AND_ASSIGN(TokenHandleFetcher);
 };
 
+}  // namespace ash
+
 #endif  // CHROME_BROWSER_ASH_LOGIN_SIGNIN_TOKEN_HANDLE_FETCHER_H_
diff --git a/chrome/browser/ash/login/signin/token_handle_util.cc b/chrome/browser/ash/login/signin/token_handle_util.cc
index 1243d30..e6a7aab1 100644
--- a/chrome/browser/ash/login/signin/token_handle_util.cc
+++ b/chrome/browser/ash/login/signin/token_handle_util.cc
@@ -13,6 +13,7 @@
 #include "google_apis/gaia/gaia_oauth_client.h"
 #include "services/network/public/cpp/shared_url_loader_factory.h"
 
+namespace ash {
 namespace {
 
 const char kTokenHandlePref[] = "PasswordTokenHandle";
@@ -251,3 +252,5 @@
   std::move(callback_).Run(account_id_, outcome);
   NotifyDone();
 }
+
+}  // namespace ash
diff --git a/chrome/browser/ash/login/signin/token_handle_util.h b/chrome/browser/ash/login/signin/token_handle_util.h
index 51d6a684..c691349d 100644
--- a/chrome/browser/ash/login/signin/token_handle_util.h
+++ b/chrome/browser/ash/login/signin/token_handle_util.h
@@ -21,6 +21,8 @@
 class DictionaryValue;
 }
 
+namespace ash {
+
 // This class is responsible for operations with External Token Handle.
 // Handle is an extra token associated with OAuth refresh token that have
 // exactly same lifetime. It is not secure, and it's only purpose is checking
@@ -101,4 +103,12 @@
   DISALLOW_COPY_AND_ASSIGN(TokenHandleUtil);
 };
 
+}  // namespace ash
+
+// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos
+// source migration is finished.
+namespace chromeos {
+using ::ash::TokenHandleUtil;
+}
+
 #endif  // CHROME_BROWSER_ASH_LOGIN_SIGNIN_TOKEN_HANDLE_UTIL_H_
diff --git a/chrome/browser/ash/login/users/chrome_user_manager_impl.cc b/chrome/browser/ash/login/users/chrome_user_manager_impl.cc
index 88926f06..58a9ab5 100644
--- a/chrome/browser/ash/login/users/chrome_user_manager_impl.cc
+++ b/chrome/browser/ash/login/users/chrome_user_manager_impl.cc
@@ -121,9 +121,7 @@
 namespace ash {
 namespace {
 
-// TODO(https://crbug.com/1164001): remove after the classes are migrated
-using ::chromeos::AuthErrorObserver;
-using ::chromeos::AuthErrorObserverFactory;
+// TODO(https://crbug.com/1164001): remove after the class is migrated
 using ::chromeos::ProxyConfigServiceImpl;
 using ::content::BrowserThread;
 
diff --git a/chrome/browser/ash/profiles/profile_helper.cc b/chrome/browser/ash/profiles/profile_helper.cc
index 127b93b..c1bc606 100644
--- a/chrome/browser/ash/profiles/profile_helper.cc
+++ b/chrome/browser/ash/profiles/profile_helper.cc
@@ -49,7 +49,6 @@
 // TODO(https://crbug.com/1164001): remove after //chrome/browser/chromeos
 // source migration is finished.
 namespace login = ::chromeos::login;
-using ::chromeos::OAuth2LoginManager;
 
 // This array contains a subset of the explicitly allowlisted extensions that
 // are defined in extensions/common/api/_behavior_features.json. The extension
@@ -443,9 +442,8 @@
   if (!IsSigninProfile(profile) &&
       user_manager::UserManager::Get()->IsLoggedInAsUserWithGaiaAccount() &&
       !user_manager::UserManager::Get()->IsLoggedInAsStub()) {
-    chromeos::OAuth2LoginManager* login_manager =
-        chromeos::OAuth2LoginManagerFactory::GetInstance()->GetForProfile(
-            profile);
+    auto* login_manager =
+        OAuth2LoginManagerFactory::GetInstance()->GetForProfile(profile);
     if (login_manager)
       login_manager->AddObserver(this);
   }
@@ -675,9 +673,8 @@
   if (state == OAuth2LoginManager::SESSION_RESTORE_DONE ||
       state == OAuth2LoginManager::SESSION_RESTORE_FAILED ||
       state == OAuth2LoginManager::SESSION_RESTORE_CONNECTION_FAILED) {
-    chromeos::OAuth2LoginManager* login_manager =
-        chromeos::OAuth2LoginManagerFactory::GetInstance()->GetForProfile(
-            user_profile);
+    auto* login_manager =
+        OAuth2LoginManagerFactory::GetInstance()->GetForProfile(user_profile);
     login_manager->RemoveObserver(this);
     ClearSigninProfile(base::OnceClosure());
   }
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index bfb70e8e..7ca412b 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -3900,10 +3900,10 @@
     // Add interstitial page while merge session process (cookie reconstruction
     // from OAuth2 refresh token in ChromeOS login) is still in progress while
     // we are attempting to load a google property.
-    if (merge_session_throttling_utils::ShouldAttachNavigationThrottle() &&
-        !merge_session_throttling_utils::AreAllSessionMergedAlready() &&
+    if (ash::merge_session_throttling_utils::ShouldAttachNavigationThrottle() &&
+        !ash::merge_session_throttling_utils::AreAllSessionMergedAlready() &&
         handle->GetURL().SchemeIsHTTPOrHTTPS()) {
-      throttles.push_back(MergeSessionNavigationThrottle::Create(handle));
+      throttles.push_back(ash::MergeSessionNavigationThrottle::Create(handle));
     }
   }
 #endif
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn
index 4a56dea..32bb7ec 100644
--- a/chrome/browser/chromeos/BUILD.gn
+++ b/chrome/browser/chromeos/BUILD.gn
@@ -1752,10 +1752,10 @@
     "../ash/login/signin/offline_signin_limiter.h",
     "../ash/login/signin/offline_signin_limiter_factory.cc",
     "../ash/login/signin/offline_signin_limiter_factory.h",
-    "../ash/login/signin/signin_error_notifier_ash.cc",
-    "../ash/login/signin/signin_error_notifier_ash.h",
-    "../ash/login/signin/signin_error_notifier_factory_ash.cc",
-    "../ash/login/signin/signin_error_notifier_factory_ash.h",
+    "../ash/login/signin/signin_error_notifier.cc",
+    "../ash/login/signin/signin_error_notifier.h",
+    "../ash/login/signin/signin_error_notifier_factory.cc",
+    "../ash/login/signin/signin_error_notifier_factory.h",
     "../ash/login/signin/token_handle_fetcher.cc",
     "../ash/login/signin/token_handle_fetcher.h",
     "../ash/login/signin/token_handle_util.cc",
@@ -3903,7 +3903,7 @@
     "../ash/login/screens/update_screen_unittest.cc",
     "../ash/login/session/user_session_manager_test.cc",
     "../ash/login/signin/offline_signin_limiter_unittest.cc",
-    "../ash/login/signin/signin_error_notifier_ash_unittest.cc",
+    "../ash/login/signin/signin_error_notifier_unittest.cc",
     "../ash/login/signin_partition_manager_unittest.cc",
     "../ash/login/ui/login_screen_extension_ui/dialog_delegate_unittest.cc",
     "../ash/login/ui/login_screen_extension_ui/web_dialog_view_unittest.cc",
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 93b3d96..0ea8b6ca 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -304,7 +304,7 @@
 #include "chrome/browser/ash/login/screens/reset_screen.h"
 #include "chrome/browser/ash/login/security_token_session_controller.h"
 #include "chrome/browser/ash/login/session/user_session_manager.h"
-#include "chrome/browser/ash/login/signin/signin_error_notifier_ash.h"
+#include "chrome/browser/ash/login/signin/signin_error_notifier.h"
 #include "chrome/browser/ash/login/startup_utils.h"
 #include "chrome/browser/ash/login/users/avatar/user_image_manager.h"
 #include "chrome/browser/ash/login/users/avatar/user_image_sync_observer.h"
@@ -1281,7 +1281,7 @@
   SecondaryAccountConsentLogger::RegisterPrefs(registry);
   ash::EduCoexistenceConsentInvalidationController::RegisterProfilePrefs(
       registry);
-  SigninErrorNotifier::RegisterPrefs(registry);
+  ash::SigninErrorNotifier::RegisterPrefs(registry);
   ash::ServicesCustomizationDocument::RegisterProfilePrefs(registry);
   chromeos::settings::OSSettingsUI::RegisterProfilePrefs(registry);
   chromeos::StartupUtils::RegisterOobeProfilePrefs(registry);
diff --git a/chrome/browser/profiles/renderer_updater.cc b/chrome/browser/profiles/renderer_updater.cc
index 5e71c1f..7b8273ed 100644
--- a/chrome/browser/profiles/renderer_updater.cc
+++ b/chrome/browser/profiles/renderer_updater.cc
@@ -61,10 +61,11 @@
   identity_manager_observation_.Observe(identity_manager_);
 #if BUILDFLAG(IS_CHROMEOS_ASH)
   oauth2_login_manager_ =
-      chromeos::OAuth2LoginManagerFactory::GetForProfile(profile_);
+      ash::OAuth2LoginManagerFactory::GetForProfile(profile_);
   oauth2_login_manager_->AddObserver(this);
   merge_session_running_ =
-      merge_session_throttling_utils::ShouldDelayRequestForProfile(profile_);
+      ash::merge_session_throttling_utils::ShouldDelayRequestForProfile(
+          profile_);
 #endif
 
   PrefService* pref_service = profile->GetPrefs();
@@ -174,9 +175,10 @@
 #if BUILDFLAG(IS_CHROMEOS_ASH)
 void RendererUpdater::OnSessionRestoreStateChanged(
     Profile* user_profile,
-    chromeos::OAuth2LoginManager::SessionRestoreState state) {
+    ash::OAuth2LoginManager::SessionRestoreState state) {
   merge_session_running_ =
-      merge_session_throttling_utils::ShouldDelayRequestForProfile(profile_);
+      ash::merge_session_throttling_utils::ShouldDelayRequestForProfile(
+          profile_);
   if (merge_session_running_)
     return;
 
diff --git a/chrome/browser/profiles/renderer_updater.h b/chrome/browser/profiles/renderer_updater.h
index 076fe26..fee01c1 100644
--- a/chrome/browser/profiles/renderer_updater.h
+++ b/chrome/browser/profiles/renderer_updater.h
@@ -30,7 +30,7 @@
 // The RendererUpdater is responsible for updating renderers about state change.
 class RendererUpdater : public KeyedService,
 #if BUILDFLAG(IS_CHROMEOS_ASH)
-                        public chromeos::OAuth2LoginManager::Observer,
+                        public ash::OAuth2LoginManager::Observer,
 #endif
                         public signin::IdentityManager::Observer {
  public:
@@ -53,10 +53,10 @@
   GetRendererConfiguration(content::RenderProcessHost* render_process_host);
 
 #if BUILDFLAG(IS_CHROMEOS_ASH)
-  // chromeos::OAuth2LoginManager::Observer:
+  // ash::OAuth2LoginManager::Observer:
   void OnSessionRestoreStateChanged(
       Profile* user_profile,
-      chromeos::OAuth2LoginManager::SessionRestoreState state) override;
+      ash::OAuth2LoginManager::SessionRestoreState state) override;
 #endif
 
   // IdentityManager::Observer:
@@ -74,7 +74,7 @@
   Profile* profile_;
   PrefChangeRegistrar pref_change_registrar_;
 #if BUILDFLAG(IS_CHROMEOS_ASH)
-  chromeos::OAuth2LoginManager* oauth2_login_manager_;
+  ash::OAuth2LoginManager* oauth2_login_manager_;
   bool merge_session_running_;
   std::vector<mojo::Remote<chrome::mojom::ChromeOSListener>>
       chromeos_listeners_;
diff --git a/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.cc b/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.cc
index 8d7a3d0..1770b9c 100644
--- a/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.cc
+++ b/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.cc
@@ -15,7 +15,7 @@
 #include "base/command_line.h"
 #include "base/scoped_observation.h"
 #include "base/task/post_task.h"
-#include "chrome/browser/ash/login/signin/signin_error_notifier_factory_ash.h"
+#include "chrome/browser/ash/login/signin/signin_error_notifier_factory.h"
 #include "chrome/browser/ash/night_light/night_light_client.h"
 #include "chrome/browser/ash/policy/display/display_resolution_handler.h"
 #include "chrome/browser/ash/policy/display/display_rotation_default_handler.h"
@@ -327,7 +327,7 @@
     if (chromeos::ProfileHelper::IsRegularProfile(profile) &&
         !profile->IsGuestSession()) {
       // Start the error notifier services to show auth/sync notifications.
-      SigninErrorNotifierFactory::GetForProfile(profile);
+      ash::SigninErrorNotifierFactory::GetForProfile(profile);
       SyncErrorNotifierFactory::GetForProfile(profile);
     }
 
diff --git a/chrome/browser/ui/webui/chromeos/account_manager/account_manager_welcome_dialog.h b/chrome/browser/ui/webui/chromeos/account_manager/account_manager_welcome_dialog.h
index 5e44302f..04c65aa 100644
--- a/chrome/browser/ui/webui/chromeos/account_manager/account_manager_welcome_dialog.h
+++ b/chrome/browser/ui/webui/chromeos/account_manager/account_manager_welcome_dialog.h
@@ -44,4 +44,10 @@
 
 }  // namespace chromeos
 
+// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos
+// source migration is finished.
+namespace ash {
+using ::chromeos::AccountManagerWelcomeDialog;
+}
+
 #endif  // CHROME_BROWSER_UI_WEBUI_CHROMEOS_ACCOUNT_MANAGER_ACCOUNT_MANAGER_WELCOME_DIALOG_H_