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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 // static | 482 // static |
483 void ExternalProviderImpl::CreateExternalProviders( | 483 void ExternalProviderImpl::CreateExternalProviders( |
484 VisitorInterface* service, | 484 VisitorInterface* service, |
485 Profile* profile, | 485 Profile* profile, |
486 ProviderCollection* provider_list) { | 486 ProviderCollection* provider_list) { |
487 TRACE_EVENT0("browser,startup", | 487 TRACE_EVENT0("browser,startup", |
488 "ExternalProviderImpl::CreateExternalProviders"); | 488 "ExternalProviderImpl::CreateExternalProviders"); |
489 scoped_refptr<ExternalLoader> external_loader; | 489 scoped_refptr<ExternalLoader> external_loader; |
490 scoped_refptr<ExternalLoader> external_recommended_loader; | 490 scoped_refptr<ExternalLoader> external_recommended_loader; |
491 extensions::Manifest::Location crx_location = Manifest::INVALID_LOCATION; | 491 extensions::Manifest::Location crx_location = Manifest::INVALID_LOCATION; |
| 492 |
492 #if defined(OS_CHROMEOS) | 493 #if defined(OS_CHROMEOS) |
| 494 if (chromeos::ProfileHelper::IsSigninProfile(profile)) { |
| 495 // Download apps installed by policy in the login profile. |
| 496 external_loader = new ExternalPolicyLoader( |
| 497 ExtensionManagementFactory::GetForBrowserContext(profile), |
| 498 ExternalPolicyLoader::FORCED); |
| 499 provider_list->push_back( |
| 500 linked_ptr<ExternalProviderInterface>(new ExternalProviderImpl( |
| 501 service, external_loader, profile, crx_location, |
| 502 Manifest::EXTERNAL_POLICY_DOWNLOAD, |
| 503 Extension::FROM_WEBSTORE | Extension::WAS_INSTALLED_BY_DEFAULT))); |
| 504 return; |
| 505 } |
| 506 |
493 policy::BrowserPolicyConnectorChromeOS* connector = | 507 policy::BrowserPolicyConnectorChromeOS* connector = |
494 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 508 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
495 bool is_chrome_os_public_session = false; | 509 bool is_chrome_os_public_session = false; |
496 const user_manager::User* user = | 510 const user_manager::User* user = |
497 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); | 511 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); |
498 policy::DeviceLocalAccount::Type account_type; | 512 policy::DeviceLocalAccount::Type account_type; |
499 if (user && | 513 if (user && |
500 connector->IsEnterpriseManaged() && | 514 connector->IsEnterpriseManaged() && |
501 policy::IsDeviceLocalAccountUser(user->email(), &account_type)) { | 515 policy::IsDeviceLocalAccountUser(user->email(), &account_type)) { |
502 if (account_type == policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION) | 516 if (account_type == policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION) |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 new ExternalProviderImpl( | 751 new ExternalProviderImpl( |
738 service, | 752 service, |
739 new ExternalComponentLoader(profile), | 753 new ExternalComponentLoader(profile), |
740 profile, | 754 profile, |
741 Manifest::INVALID_LOCATION, | 755 Manifest::INVALID_LOCATION, |
742 Manifest::EXTERNAL_COMPONENT, | 756 Manifest::EXTERNAL_COMPONENT, |
743 Extension::FROM_WEBSTORE | Extension::WAS_INSTALLED_BY_DEFAULT))); | 757 Extension::FROM_WEBSTORE | Extension::WAS_INSTALLED_BY_DEFAULT))); |
744 } | 758 } |
745 | 759 |
746 } // namespace extensions | 760 } // namespace extensions |
OLD | NEW |