Refactor kiosk app external loader creation

Prior to this change KioskAppManager exposed methods for creating
kiosk app external loaders - when creating them, KioskAppManager would
remember their weak ptrs in order to later notify them when the kiosk
apps are ready to be installed.

After this cl, kiosk app external loaders will be created directly by
ExternalProviderImpl. When initialized, the external loaders will
register callback with KioskAppManager that will be run when kiosk
apps become ready to be installed. When the callback is run, the
KioskAppExternalLoader will forward the kiosk apps prefs dictionary
to it's owner (using extensions::ExternalLoader inerface).

Additionally, when kiosk apps are updated after the initial app
propoerties have been set, use ExternalLoader::OnUpdated rather than
ExternalLoader::LoadFinished - to avoid CHECK crash, add a option to
explicitly allow external extension set updates to
ExternalProviderImpl (instead of relying on CRX and update url
sources assigned to associated external loader).

BUG=686901

Change-Id: Ie9ee272ee055e39ccde747e13652fbc0fb6ccfd0
Reviewed-on: https://chromium-review.googlesource.com/845264
Commit-Queue: Toni Barzic <[email protected]>
Reviewed-by: Devlin <[email protected]>
Reviewed-by: Xiyuan Xia <[email protected]>
Cr-Commit-Position: refs/heads/master@{#528058}
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc
index b344cfc..8335f20 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -387,6 +387,8 @@
     provider_.reset(new extensions::ExternalProviderImpl(
         this, new extensions::ExternalTestingLoader(json_data, fake_base_path_),
         profile_.get(), crx_location, download_location, Extension::NO_FLAGS));
+    if (crx_location == Manifest::EXTERNAL_REGISTRY)
+      provider_->set_allow_updates(true);
 
     // We also parse the file into a dictionary to compare what we get back
     // from the provider.