Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3697)

Unified Diff: chrome/browser/extensions/external_provider_impl.cc

Issue 2149953002: Enable login screen apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Stefan feedback Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/profiles/profile_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..28368ee42d784b824de550259ba6feb7a8da045f 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,23 @@ 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. Flags
+ // FROM_WEBSTORE/WAS_INSTALLED_BY_DEFAULT are applied because these apps are
+ // downloaded from the webstore, and we want to treat them as built-in
+ // extensions.
+ 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));
+ return;
+ }
+
policy::BrowserPolicyConnectorChromeOS* connector =
g_browser_process->platform_part()->browser_policy_connector_chromeos();
bool is_chrome_os_public_session = false;
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/profiles/profile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698