User service is actually the file service.

My original thought was that this service could host a lot of user-specific components. However I began to think that this would make this service as monolithic/problematic as Profile, which kind of defeats the purpose. Having a discrete user-scoped file system service seems valuable in and of itself.

Individual profile-specific services should just be their own services - e.g. preferences, which can be run with the profile's service user-id, so you end up with a preferences instance per profile.

[email protected]

Committed: https://crrev.com/23fcb4aca6178fa8d6c125db778f62fce34a7c67
Review-Url: https://codereview.chromium.org/2207663003
Cr-Original-Commit-Position: refs/heads/master@{#411357}
Cr-Commit-Position: refs/heads/master@{#411475}
diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc
index 7cbb5f4..6ca86e7 100644
--- a/content/browser/browser_context.cc
+++ b/content/browser/browser_context.cc
@@ -38,12 +38,12 @@
 #include "net/ssl/channel_id_store.h"
 #include "net/url_request/url_request_context.h"
 #include "net/url_request/url_request_context_getter.h"
+#include "services/file/file_service.h"
+#include "services/file/public/cpp/constants.h"
+#include "services/file/user_id_map.h"
 #include "services/shell/public/cpp/connection.h"
 #include "services/shell/public/cpp/connector.h"
 #include "services/shell/public/interfaces/service.mojom.h"
-#include "services/user/public/cpp/constants.h"
-#include "services/user/user_id_map.h"
-#include "services/user/user_shell_client.h"
 #include "storage/browser/database/database_tracker.h"
 #include "storage/browser/fileapi/external_mount_points.h"
 
@@ -403,8 +403,8 @@
   ShellUserIdHolder* holder = static_cast<ShellUserIdHolder*>(
       browser_context->GetUserData(kMojoShellUserId));
   if (holder)
-    user_service::ForgetShellUserIdUserDirAssociation(holder->user_id());
-  user_service::AssociateShellUserIdWithUserDir(new_id, path);
+    file::ForgetShellUserIdUserDirAssociation(holder->user_id());
+  file::AssociateShellUserIdWithUserDir(new_id, path);
   RemoveBrowserContextFromUserIdMap(browser_context);
   g_user_id_to_context.Get()[new_id] = browser_context;
   browser_context->SetUserData(kMojoShellUserId,
@@ -443,10 +443,10 @@
             switches::kMojoLocalStorage)) {
       MojoApplicationInfo info;
       info.application_factory =
-          base::Bind(&user_service::CreateUserService,
+          base::Bind(&file::CreateFileService,
                      BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE),
                      BrowserThread::GetTaskRunnerForThread(BrowserThread::DB));
-      connection->AddEmbeddedService(user_service::kUserServiceName, info);
+      connection->AddEmbeddedService(file::kFileServiceName, info);
     }
   }
 }