Migrate AppService off the mojo pref service

The app service runs in the browser process on the UI thread.
It can directly use the Profile's PrefService* to access prefs.
This simplifies the code, in particular avoiding some cases
where the connection to the pref service might not be available
yet.

AppService is also the last remaining customer of the mojo pref
service, so this is also a step toward deleting the mojo pref
service entirely.

Bug: 977637
Test: unit_tests

Change-Id: Ia6cb9377ed1dbbd72b16e8ac2bda162a199c8fa8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1920003
Commit-Queue: James Cook <[email protected]>
Reviewed-by: Ken Rockot <[email protected]>
Reviewed-by: Maggie Cai <[email protected]>
Reviewed-by: Dominick Ng <[email protected]>
Reviewed-by: Dominic Battré <[email protected]>
Cr-Commit-Position: refs/heads/master@{#716676}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 09b24f6..aed1051 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -216,6 +216,7 @@
 #include "components/feed/core/pref_names.h"
 #endif  // BUILDFLAG(ENABLE_FEED_IN_CHROME)
 #else   // defined(OS_ANDROID)
+#include "chrome/browser/apps/app_service/app_service_proxy.h"
 #include "chrome/browser/enterprise_reporting/prefs.h"
 #include "chrome/browser/gcm/gcm_product_util.h"
 #include "chrome/browser/metrics/tab_stats_tracker.h"
@@ -892,6 +893,7 @@
   feed::RegisterProfilePrefs(registry);
 #endif  // BUILDFLAG(ENABLE_FEED_IN_CHROME)
 #else
+  apps::AppServiceProxy::RegisterProfilePrefs(registry);
   AppShortcutManager::RegisterProfilePrefs(registry);
   DeviceIDFetcher::RegisterProfilePrefs(registry);
   DevToolsWindow::RegisterProfilePrefs(registry);