Chromium Code Reviews| Index: chrome/browser/extensions/external_provider_impl.cc |
| diff --git a/chrome/browser/extensions/external_provider_impl.cc b/chrome/browser/extensions/external_provider_impl.cc |
| index aa4cc325e4769bb9d5c7e1fa3642a92650a0ae61..b3139d3f7f026e50034ec70c1fae94ae808bcf33 100644 |
| --- a/chrome/browser/extensions/external_provider_impl.cc |
| +++ b/chrome/browser/extensions/external_provider_impl.cc |
| @@ -140,8 +140,9 @@ void ExternalProviderImpl::SetPrefs(base::DictionaryValue* prefs) { |
| void ExternalProviderImpl::UpdatePrefs(base::DictionaryValue* prefs) { |
| CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| - // We only expect updates from windows registry. |
| - CHECK(crx_location_ == Manifest::EXTERNAL_REGISTRY); |
| + // We only expect updates from windows registry or via policies on chromeos. |
| + CHECK(crx_location_ == Manifest::EXTERNAL_REGISTRY || |
| + download_location_ == Manifest::EXTERNAL_POLICY_DOWNLOAD); |
| // Check if the service is still alive. It is possible that it went |
| // away while |loader_| was working on the FILE thread. |
| @@ -497,7 +498,20 @@ void ExternalProviderImpl::CreateExternalProviders( |
| scoped_refptr<ExternalLoader> external_loader; |
| scoped_refptr<ExternalLoader> external_recommended_loader; |
| extensions::Manifest::Location crx_location = Manifest::INVALID_LOCATION; |
| + |
| #if defined(OS_CHROMEOS) |
| + if (chromeos::ProfileHelper::IsSigninProfile(profile)) { |
| + // Download apps installed by policy in the login profile. |
| + external_loader = new ExternalPolicyLoader( |
| + ExtensionManagementFactory::GetForBrowserContext(profile), |
| + ExternalPolicyLoader::FORCED); |
| + provider_list->push_back(base::MakeUnique<ExternalProviderImpl>( |
| + service, external_loader, profile, crx_location, |
| + Manifest::EXTERNAL_POLICY_DOWNLOAD, |
| + Extension::FROM_WEBSTORE | Extension::WAS_INSTALLED_BY_DEFAULT)); |
|
Devlin
2017/03/17 16:37:23
We should add a comment explaining why these flags
achuithb
2017/03/22 00:15:53
Done.
|
| + return; |
| + } |
| + |
| policy::BrowserPolicyConnectorChromeOS* connector = |
| g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
| bool is_chrome_os_public_session = false; |