Plumbing for login apps device policy to extensions.

Device policy kDeviceLoginScreenAppInstallList is parsed and stored as the pref kInstallLoginScreenAppList.

ExtensionManagement:
* Factor out common code into GetInstallListByMode from
GetForceInstallList and GetRecommendedInstallList.
* Common function UpdateForcedExtensions.
* is_signin_profile so kInstallLoginScreenAppList is only set in the chromeos signin profile.

ExtensionInstallListPolicyHandler:
* Common base class to parse login screen app and force extension install lists.

ExtensionPref:
* extensions.install.login_screen_app_list.

BUG=576464

Review-Url: https://codereview.chromium.org/2144313002
Cr-Commit-Position: refs/heads/master@{#455434}
diff --git a/chrome/browser/extensions/extension_management.h b/chrome/browser/extensions/extension_management.h
index 58c621f90..a686f34 100644
--- a/chrome/browser/extensions/extension_management.h
+++ b/chrome/browser/extensions/extension_management.h
@@ -70,7 +70,7 @@
     INSTALLATION_RECOMMENDED,
   };
 
-  explicit ExtensionManagement(PrefService* pref_service);
+  ExtensionManagement(PrefService* pref_service, bool is_signin_profile);
   ~ExtensionManagement() override;
 
   // KeyedService implementations:
@@ -153,6 +153,14 @@
   void OnExtensionPrefChanged();
   void NotifyExtensionManagementPrefChanged();
 
+  // Helper to return an extension install list, in format specified by
+  // ExternalPolicyLoader::AddExtension().
+  std::unique_ptr<base::DictionaryValue> GetInstallListByMode(
+      InstallationMode installation_mode) const;
+
+  // Helper to update |extension_dict| for forced installs.
+  void UpdateForcedExtensions(const base::DictionaryValue* extension_dict);
+
   // Helper function to access |settings_by_id_| with |id| as key.
   // Adds a new IndividualSettings entry to |settings_by_id_| if none exists for
   // |id| yet.
@@ -183,7 +191,8 @@
   // Extension settings applicable to all extensions.
   std::unique_ptr<internal::GlobalSettings> global_settings_;
 
-  PrefService* pref_service_;
+  PrefService* pref_service_ = nullptr;
+  bool is_signin_profile_ = false;
 
   base::ObserverList<Observer, true> observer_list_;
   PrefChangeRegistrar pref_change_registrar_;