OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/extensions/external_provider_impl.h" | 5 #include "chrome/browser/extensions/external_provider_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
490 // static | 490 // static |
491 void ExternalProviderImpl::CreateExternalProviders( | 491 void ExternalProviderImpl::CreateExternalProviders( |
492 VisitorInterface* service, | 492 VisitorInterface* service, |
493 Profile* profile, | 493 Profile* profile, |
494 ProviderCollection* provider_list) { | 494 ProviderCollection* provider_list) { |
495 TRACE_EVENT0("browser,startup", | 495 TRACE_EVENT0("browser,startup", |
496 "ExternalProviderImpl::CreateExternalProviders"); | 496 "ExternalProviderImpl::CreateExternalProviders"); |
497 scoped_refptr<ExternalLoader> external_loader; | 497 scoped_refptr<ExternalLoader> external_loader; |
498 scoped_refptr<ExternalLoader> external_recommended_loader; | 498 scoped_refptr<ExternalLoader> external_recommended_loader; |
499 extensions::Manifest::Location crx_location = Manifest::INVALID_LOCATION; | 499 extensions::Manifest::Location crx_location = Manifest::INVALID_LOCATION; |
500 | |
500 #if defined(OS_CHROMEOS) | 501 #if defined(OS_CHROMEOS) |
502 if (chromeos::ProfileHelper::IsSigninProfile(profile)) { | |
Devlin
2017/03/01 16:15:00
Should we check if the command line switch is pres
| |
503 // Download apps installed by policy in the sign-in profile. | |
504 external_loader = new ExternalPolicyLoader( | |
505 ExtensionManagementFactory::GetForBrowserContext(profile), | |
506 ExternalPolicyLoader::FORCED); | |
507 provider_list->push_back( | |
508 std::unique_ptr<ExternalProviderInterface>(new ExternalProviderImpl( | |
509 service, external_loader, profile, crx_location, | |
510 Manifest::EXTERNAL_POLICY_DOWNLOAD, | |
511 Extension::FROM_WEBSTORE | Extension::WAS_INSTALLED_BY_DEFAULT))); | |
512 return; | |
Devlin
2017/03/01 16:15:00
Are we certain we don't want any other providers i
| |
513 } | |
514 | |
501 policy::BrowserPolicyConnectorChromeOS* connector = | 515 policy::BrowserPolicyConnectorChromeOS* connector = |
502 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 516 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
503 bool is_chrome_os_public_session = false; | 517 bool is_chrome_os_public_session = false; |
504 const user_manager::User* user = | 518 const user_manager::User* user = |
505 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); | 519 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); |
506 policy::DeviceLocalAccount::Type account_type; | 520 policy::DeviceLocalAccount::Type account_type; |
507 if (user && connector->IsEnterpriseManaged() && | 521 if (user && connector->IsEnterpriseManaged() && |
508 policy::IsDeviceLocalAccountUser(user->GetAccountId().GetUserEmail(), | 522 policy::IsDeviceLocalAccountUser(user->GetAccountId().GetUserEmail(), |
509 &account_type)) { | 523 &account_type)) { |
510 if (account_type == policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION) | 524 if (account_type == policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION) |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
695 provider_list->push_back(std::move(drive_migration_provider)); | 709 provider_list->push_back(std::move(drive_migration_provider)); |
696 } | 710 } |
697 | 711 |
698 provider_list->push_back(base::MakeUnique<ExternalProviderImpl>( | 712 provider_list->push_back(base::MakeUnique<ExternalProviderImpl>( |
699 service, new ExternalComponentLoader(profile), profile, | 713 service, new ExternalComponentLoader(profile), profile, |
700 Manifest::INVALID_LOCATION, Manifest::EXTERNAL_COMPONENT, | 714 Manifest::INVALID_LOCATION, Manifest::EXTERNAL_COMPONENT, |
701 Extension::FROM_WEBSTORE | Extension::WAS_INSTALLED_BY_DEFAULT)); | 715 Extension::FROM_WEBSTORE | Extension::WAS_INSTALLED_BY_DEFAULT)); |
702 } | 716 } |
703 | 717 |
704 } // namespace extensions | 718 } // namespace extensions |
OLD | NEW |