Reland "Migrate chromeos/ash/components/local_search_service/ to namespace ash"

This reverts commit 15ffa9ff13bd9dcdcbd87742883cd9292adf59d2.

Reason for revert: fixed the ChromeOS build failure in
https://crrev.com/c/3758135.

Original change's description:
> Revert "Migrate chromeos/ash/components/local_search_service/ to namespace ash"
>
> This reverts commit 52a6f4842c83b78aa2b4fae06ab68341715efb6c.
>
> Reason for revert:
> Speculative revert for `apps.SearchInHelpApp.stable` failing on
> chromeos bots.
> https://ci.chromium.org/ui/p/chrome/builders/ci/chromeos-betty-pi-arc-cfi-thin-lto-chrome/37270/overview
>
> Original change's description:
> > Migrate chromeos/ash/components/local_search_service/ to namespace ash
> >
> > This CL is part of the Chrome OS source code directory migration:
> > https://docs.google.com/document/d/1g-98HpzA8XcoGBWUv1gQNr4rbnD5yfvbtYZyPDDbkaE.
> >
> > Bug: 1164001
> > Change-Id: Ia155e881d0f668fac0e6dc2923c0f461136358a5
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3745562
> > Reviewed-by: Rachel Wong <[email protected]>
> > Commit-Queue: Henrique Ferreiro <[email protected]>
> > Reviewed-by: Hidehiko Abe <[email protected]>
> > Owners-Override: Hidehiko Abe <[email protected]>
> > Cr-Commit-Position: refs/heads/main@{#1022863}
>
> Bug: 1164001
> Change-Id: I559f6e5d0923f390afef2b29884dcd5ced9d6cde
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3750692
> Commit-Queue: Hiroki Nakagawa <[email protected]>
> Owners-Override: Hiroki Nakagawa <[email protected]>
> Bot-Commit: Rubber Stamper <[email protected]>
> Cr-Commit-Position: refs/heads/main@{#1023060}

Bug: 1164001
Change-Id: I7064fe8c9d28e13c795c5f1f967520c8d9a91184
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3762611
Owners-Override: Hidehiko Abe <[email protected]>
Reviewed-by: Hidehiko Abe <[email protected]>
Commit-Queue: Henrique Ferreiro <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1044329}
diff --git a/chrome/browser/ash/web_applications/personalization_app/personalization_app_manager.cc b/chrome/browser/ash/web_applications/personalization_app/personalization_app_manager.cc
index cfa380b..f3c34d2 100644
--- a/chrome/browser/ash/web_applications/personalization_app/personalization_app_manager.cc
+++ b/chrome/browser/ash/web_applications/personalization_app/personalization_app_manager.cc
@@ -43,8 +43,7 @@
  public:
   PersonalizationAppManagerImpl(
       content::BrowserContext* context,
-      ::chromeos::local_search_service::LocalSearchServiceProxy&
-          local_search_service_proxy)
+      local_search_service::LocalSearchServiceProxy& local_search_service_proxy)
       : profile_(Profile::FromBrowserContext(context)) {
     DCHECK(profile_);
     if (ash::features::IsPersonalizationHubEnabled()) {
@@ -108,8 +107,7 @@
 // static
 std::unique_ptr<PersonalizationAppManager> PersonalizationAppManager::Create(
     content::BrowserContext* context,
-    ::chromeos::local_search_service::LocalSearchServiceProxy&
-        local_search_service_proxy) {
+    local_search_service::LocalSearchServiceProxy& local_search_service_proxy) {
   return std::make_unique<PersonalizationAppManagerImpl>(
       context, local_search_service_proxy);
 }
diff --git a/chrome/browser/ash/web_applications/personalization_app/personalization_app_manager.h b/chrome/browser/ash/web_applications/personalization_app/personalization_app_manager.h
index 085f01b..8702ce7 100644
--- a/chrome/browser/ash/web_applications/personalization_app/personalization_app_manager.h
+++ b/chrome/browser/ash/web_applications/personalization_app/personalization_app_manager.h
@@ -11,14 +11,12 @@
 #include "components/keyed_service/core/keyed_service.h"
 #include "content/public/browser/browser_context.h"
 
-// TODO(https://crbug.com/1164001): move forward declaration to ash.
-namespace chromeos {
+namespace ash {
+
 namespace local_search_service {
 class LocalSearchServiceProxy;
-}  // namespace local_search_service
-}  // namespace chromeos
+}
 
-namespace ash {
 namespace personalization_app {
 
 enum class HatsSurveyType {
@@ -37,7 +35,7 @@
  public:
   static std::unique_ptr<PersonalizationAppManager> Create(
       content::BrowserContext* context,
-      ::chromeos::local_search_service::LocalSearchServiceProxy&
+      local_search_service::LocalSearchServiceProxy&
           local_search_service_proxy);
 
   ~PersonalizationAppManager() override = default;
diff --git a/chrome/browser/ash/web_applications/personalization_app/personalization_app_manager_factory.cc b/chrome/browser/ash/web_applications/personalization_app/personalization_app_manager_factory.cc
index c1efcb69..8f2ddab 100644
--- a/chrome/browser/ash/web_applications/personalization_app/personalization_app_manager_factory.cc
+++ b/chrome/browser/ash/web_applications/personalization_app/personalization_app_manager_factory.cc
@@ -48,8 +48,8 @@
 PersonalizationAppManagerFactory::PersonalizationAppManagerFactory()
     : ProfileKeyedServiceFactory("PersonalizationAppManager",
                                  BuildProfileSelections()) {
-  DependsOn(::chromeos::local_search_service::LocalSearchServiceProxyFactory::
-                GetInstance());
+  DependsOn(
+      local_search_service::LocalSearchServiceProxyFactory::GetInstance());
 }
 
 PersonalizationAppManagerFactory::~PersonalizationAppManagerFactory() = default;
@@ -58,7 +58,7 @@
     content::BrowserContext* context) const {
   DCHECK(CanSeeWallpaperOrPersonalizationApp(
       Profile::FromBrowserContext(context)));
-  auto* local_search_service_proxy = ::chromeos::local_search_service::
+  auto* local_search_service_proxy = local_search_service::
       LocalSearchServiceProxyFactory::GetForBrowserContext(context);
   DCHECK(local_search_service_proxy);
 
diff --git a/chrome/browser/chrome_browser_interface_binders.cc b/chrome/browser/chrome_browser_interface_binders.cc
index 9ef082f..bf32f28 100644
--- a/chrome/browser/chrome_browser_interface_binders.cc
+++ b/chrome/browser/chrome_browser_interface_binders.cc
@@ -1126,7 +1126,7 @@
       ash::help_app::mojom::PageHandlerFactory, ash::HelpAppUI>(map);
 
   RegisterWebUIControllerInterfaceBinder<
-      chromeos::local_search_service::mojom::Index, ash::HelpAppUI>(map);
+      ash::local_search_service::mojom::Index, ash::HelpAppUI>(map);
 
   RegisterWebUIControllerInterfaceBinder<ash::help_app::mojom::SearchHandler,
                                          ash::HelpAppUI>(map);
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 8368af9..952f37e 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -1139,8 +1139,8 @@
   ash::KioskAppManager::RegisterLocalStatePrefs(registry);
   ash::KioskCryptohomeRemover::RegisterPrefs(registry);
   ash::language_prefs::RegisterPrefs(registry);
-  chromeos::local_search_service::SearchMetricsReporter::
-      RegisterLocalStatePrefs(registry);
+  ash::local_search_service::SearchMetricsReporter::RegisterLocalStatePrefs(
+      registry);
   ash::login::SecurityTokenSessionController::RegisterLocalStatePrefs(registry);
   ash::reporting::LoginLogoutReporter::RegisterPrefs(registry);
   ash::MultiProfileUserController::RegisterPrefs(registry);
diff --git a/chrome/browser/ui/webui/settings/ash/os_settings_manager.h b/chrome/browser/ui/webui/settings/ash/os_settings_manager.h
index ee7af62..e41fabf 100644
--- a/chrome/browser/ui/webui/settings/ash/os_settings_manager.h
+++ b/chrome/browser/ui/webui/settings/ash/os_settings_manager.h
@@ -20,6 +20,8 @@
 #include "chrome/browser/ash/kerberos/kerberos_credentials_manager.h"
 // TODO(https://crbug.com/1164001): forward declare when moved ash
 #include "chrome/browser/ash/printing/cups_printers_manager.h"
+// TODO(https://crbug.com/1164001): forward declare when moved ash
+#include "chromeos/ash/components/local_search_service/public/cpp/local_search_service_proxy.h"
 #include "components/keyed_service/core/keyed_service.h"
 
 class ArcAppListPrefs;
@@ -39,13 +41,7 @@
 class SyncService;
 }  // namespace syncer
 
-namespace chromeos {
-
-namespace local_search_service {
-class LocalSearchServiceProxy;
-}  // namespace local_search_service
-
-namespace settings {
+namespace chromeos::settings {
 
 class Hierarchy;
 class OsSettingsSections;
@@ -135,7 +131,6 @@
   std::unique_ptr<AppNotificationHandler> app_notification_handler_;
 };
 
-}  // namespace settings
-}  // namespace chromeos
+}  // namespace chromeos::settings
 
 #endif  // CHROME_BROWSER_UI_WEBUI_SETTINGS_ASH_OS_SETTINGS_MANAGER_H_
diff --git a/chrome/browser/ui/webui/settings/ash/os_settings_manager_factory.cc b/chrome/browser/ui/webui/settings/ash/os_settings_manager_factory.cc
index 1623509..ca6d90c 100644
--- a/chrome/browser/ui/webui/settings/ash/os_settings_manager_factory.cc
+++ b/chrome/browser/ui/webui/settings/ash/os_settings_manager_factory.cc
@@ -23,6 +23,8 @@
 namespace chromeos {
 namespace settings {
 
+namespace local_search_service = ::ash::local_search_service;
+
 // static
 OsSettingsManager* OsSettingsManagerFactory::GetForProfile(Profile* profile) {
   return static_cast<OsSettingsManager*>(
diff --git a/chrome/browser/ui/webui/settings/ash/os_settings_manager_unittest.cc b/chrome/browser/ui/webui/settings/ash/os_settings_manager_unittest.cc
index 97b157f..56f5528 100644
--- a/chrome/browser/ui/webui/settings/ash/os_settings_manager_unittest.cc
+++ b/chrome/browser/ui/webui/settings/ash/os_settings_manager_unittest.cc
@@ -36,6 +36,8 @@
 namespace chromeos {
 namespace settings {
 
+namespace local_search_service = ::ash::local_search_service;
+
 // Verifies the OsSettingsManager initialization flow. Behavioral functionality
 // is tested via unit tests on the sub-elements owned by OsSettingsManager.
 class OsSettingsManagerTest : public testing::Test {
diff --git a/chrome/browser/ui/webui/settings/ash/search/search_handler.cc b/chrome/browser/ui/webui/settings/ash/search/search_handler.cc
index b5d81c3..264489d 100644
--- a/chrome/browser/ui/webui/settings/ash/search/search_handler.cc
+++ b/chrome/browser/ui/webui/settings/ash/search/search_handler.cc
@@ -17,8 +17,12 @@
 
 namespace chromeos {
 namespace settings {
+
 namespace {
 
+// TODO(https://crbug.com/1164001): remove after migrating this file to ns ash.
+namespace local_search_service = ::ash::local_search_service;
+
 bool ContainsSectionResult(const std::vector<mojom::SearchResultPtr>& results,
                            mojom::Section section) {
   return base::ranges::find_if(results, [section](const auto& result) {
diff --git a/chrome/browser/ui/webui/settings/ash/search/search_handler.h b/chrome/browser/ui/webui/settings/ash/search/search_handler.h
index fd7722d7..998910a 100644
--- a/chrome/browser/ui/webui/settings/ash/search/search_handler.h
+++ b/chrome/browser/ui/webui/settings/ash/search/search_handler.h
@@ -107,7 +107,7 @@
   SearchTagRegistry* search_tag_registry_;
   OsSettingsSections* sections_;
   Hierarchy* hierarchy_;
-  mojo::Remote<local_search_service::mojom::Index> index_remote_;
+  mojo::Remote<ash::local_search_service::mojom::Index> index_remote_;
 
   // Note: Expected to have multiple clients, so ReceiverSet/RemoteSet are used.
   mojo::ReceiverSet<mojom::SearchHandler> receivers_;
diff --git a/chrome/browser/ui/webui/settings/ash/search/search_tag_registry.cc b/chrome/browser/ui/webui/settings/ash/search/search_tag_registry.cc
index 44c862d..6793903f 100644
--- a/chrome/browser/ui/webui/settings/ash/search/search_tag_registry.cc
+++ b/chrome/browser/ui/webui/settings/ash/search/search_tag_registry.cc
@@ -16,8 +16,12 @@
 
 namespace chromeos {
 namespace settings {
+
 namespace {
 
+// TODO(https://crbug.com/1164001): remove after migrating this file to ns ash.
+namespace local_search_service = ::ash::local_search_service;
+
 std::vector<int> GetMessageIds(const SearchConcept* search_concept) {
   // Start with only the canonical ID.
   std::vector<int> alt_tag_message_ids{search_concept->canonical_message_id};
diff --git a/chrome/browser/ui/webui/settings/ash/search/search_tag_registry.h b/chrome/browser/ui/webui/settings/ash/search/search_tag_registry.h
index 613f513..04f7647a 100644
--- a/chrome/browser/ui/webui/settings/ash/search/search_tag_registry.h
+++ b/chrome/browser/ui/webui/settings/ash/search/search_tag_registry.h
@@ -60,8 +60,8 @@
     std::unordered_map<std::string, ConceptWithShouldAddBool> pending_updates_;
   };
 
-  SearchTagRegistry(local_search_service::LocalSearchServiceProxy*
-                        local_search_service_proxy);
+  explicit SearchTagRegistry(local_search_service::LocalSearchServiceProxy*
+                                 local_search_service_proxy);
   SearchTagRegistry(const SearchTagRegistry& other) = delete;
   SearchTagRegistry& operator=(const SearchTagRegistry& other) = delete;
   virtual ~SearchTagRegistry();
@@ -87,14 +87,14 @@
   void AddSearchTags(const std::vector<const SearchConcept*>& search_tags);
   void RemoveSearchTags(const std::vector<const SearchConcept*>& search_tags);
 
-  std::vector<local_search_service::Data> ConceptVectorToDataVector(
+  std::vector<ash::local_search_service::Data> ConceptVectorToDataVector(
       const std::vector<const SearchConcept*>& search_tags);
   void NotifyRegistryUpdated();
   void NotifyRegistryAdded();
   void NotifyRegistryDeleted(uint32_t /*num_deleted*/);
 
   // Index used by the LocalSearchService for string matching.
-  mojo::Remote<local_search_service::mojom::Index> index_remote_;
+  mojo::Remote<ash::local_search_service::mojom::Index> index_remote_;
 
   // In-memory cache of all results which have been added to the
   // LocalSearchService. Contents are kept in sync with |index_remote_|.
diff --git a/chrome/browser/ui/webui/settings/ash/search/search_tag_registry_unittest.cc b/chrome/browser/ui/webui/settings/ash/search/search_tag_registry_unittest.cc
index bb47722b..8813031 100644
--- a/chrome/browser/ui/webui/settings/ash/search/search_tag_registry_unittest.cc
+++ b/chrome/browser/ui/webui/settings/ash/search/search_tag_registry_unittest.cc
@@ -15,8 +15,12 @@
 
 namespace chromeos {
 namespace settings {
+
 namespace {
 
+// TODO(https://crbug.com/1164001): remove after migrating this file to ns ash.
+namespace local_search_service = ::ash::local_search_service;
+
 class FakeObserver : public SearchTagRegistry::Observer {
  public:
   FakeObserver() = default;