| 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 | |
| 501 #if defined(OS_CHROMEOS) | 500 #if defined(OS_CHROMEOS) |
| 502 if (chromeos::ProfileHelper::IsSigninProfile(profile)) { | |
| 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; | |
| 513 } | |
| 514 | |
| 515 policy::BrowserPolicyConnectorChromeOS* connector = | 501 policy::BrowserPolicyConnectorChromeOS* connector = |
| 516 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 502 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
| 517 bool is_chrome_os_public_session = false; | 503 bool is_chrome_os_public_session = false; |
| 518 const user_manager::User* user = | 504 const user_manager::User* user = |
| 519 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); | 505 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); |
| 520 policy::DeviceLocalAccount::Type account_type; | 506 policy::DeviceLocalAccount::Type account_type; |
| 521 if (user && connector->IsEnterpriseManaged() && | 507 if (user && connector->IsEnterpriseManaged() && |
| 522 policy::IsDeviceLocalAccountUser(user->GetAccountId().GetUserEmail(), | 508 policy::IsDeviceLocalAccountUser(user->GetAccountId().GetUserEmail(), |
| 523 &account_type)) { | 509 &account_type)) { |
| 524 if (account_type == policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION) | 510 if (account_type == policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION) |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 provider_list->push_back(std::move(drive_migration_provider)); | 695 provider_list->push_back(std::move(drive_migration_provider)); |
| 710 } | 696 } |
| 711 | 697 |
| 712 provider_list->push_back(base::MakeUnique<ExternalProviderImpl>( | 698 provider_list->push_back(base::MakeUnique<ExternalProviderImpl>( |
| 713 service, new ExternalComponentLoader(profile), profile, | 699 service, new ExternalComponentLoader(profile), profile, |
| 714 Manifest::INVALID_LOCATION, Manifest::EXTERNAL_COMPONENT, | 700 Manifest::INVALID_LOCATION, Manifest::EXTERNAL_COMPONENT, |
| 715 Extension::FROM_WEBSTORE | Extension::WAS_INSTALLED_BY_DEFAULT)); | 701 Extension::FROM_WEBSTORE | Extension::WAS_INSTALLED_BY_DEFAULT)); |
| 716 } | 702 } |
| 717 | 703 |
| 718 } // namespace extensions | 704 } // namespace extensions |
| OLD | NEW |