apps: Fix accessing to profile from non-UI thread.

In order to define type of profile (supervised and child case), it is
required internally to request pref value that in general non-safe from
non-UI thread. This CL switch to resolving user type on UI thread.

TEST=Locally with DCHECK on + extra logging to confirm fix
(eve + nocturne).
BUG=930404

Change-Id: I6f84c6e33d1b6c807b7a077393a35b0b9a10736b
Reviewed-on: https://chromium-review.googlesource.com/c/1462417
Reviewed-by: Ben Wells <[email protected]>
Commit-Queue: Yury Khmel <[email protected]>
Cr-Commit-Position: refs/heads/master@{#631053}
diff --git a/chrome/browser/extensions/external_pref_loader.h b/chrome/browser/extensions/external_pref_loader.h
index a13c0da..b06e9c9 100644
--- a/chrome/browser/extensions/external_pref_loader.h
+++ b/chrome/browser/extensions/external_pref_loader.h
@@ -112,6 +112,10 @@
   // Needed for waiting for waiting priority sync.
   Profile* profile_;
 
+  // User type determined by |profile_|. Used to filter extensions. In some unit
+  // tests may not be set.
+  const std::string user_type_;
+
   std::vector<std::unique_ptr<PrioritySyncReadyWaiter>> pending_waiter_list_;
 
   DISALLOW_COPY_AND_ASSIGN(ExternalPrefLoader);