| 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 <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 extensions::Manifest::Location crx_location = Manifest::INVALID_LOCATION; | 429 extensions::Manifest::Location crx_location = Manifest::INVALID_LOCATION; |
| 430 #if defined(OS_CHROMEOS) | 430 #if defined(OS_CHROMEOS) |
| 431 policy::BrowserPolicyConnectorChromeOS* connector = | 431 policy::BrowserPolicyConnectorChromeOS* connector = |
| 432 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 432 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
| 433 bool is_chrome_os_public_session = false; | 433 bool is_chrome_os_public_session = false; |
| 434 const user_manager::User* user = | 434 const user_manager::User* user = |
| 435 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); | 435 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); |
| 436 policy::DeviceLocalAccount::Type account_type; | 436 policy::DeviceLocalAccount::Type account_type; |
| 437 if (user && | 437 if (user && |
| 438 connector->IsEnterpriseManaged() && | 438 connector->IsEnterpriseManaged() && |
| 439 policy::IsDeviceLocalAccountUser(user->email(), &account_type)) { | 439 policy::IsDeviceLocalAccountUser(user->GetUserID(), &account_type)) { |
| 440 if (account_type == policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION) | 440 if (account_type == policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION) |
| 441 is_chrome_os_public_session = true; | 441 is_chrome_os_public_session = true; |
| 442 policy::DeviceLocalAccountPolicyBroker* broker = | 442 policy::DeviceLocalAccountPolicyBroker* broker = |
| 443 connector->GetDeviceLocalAccountPolicyService()->GetBrokerForUser( | 443 connector->GetDeviceLocalAccountPolicyService()->GetBrokerForUser( |
| 444 user->email()); | 444 user->GetUserID()); |
| 445 if (broker) { | 445 if (broker) { |
| 446 external_loader = broker->extension_loader(); | 446 external_loader = broker->extension_loader(); |
| 447 crx_location = Manifest::EXTERNAL_POLICY; | 447 crx_location = Manifest::EXTERNAL_POLICY; |
| 448 } else { | 448 } else { |
| 449 NOTREACHED(); | 449 NOTREACHED(); |
| 450 } | 450 } |
| 451 } else { | 451 } else { |
| 452 external_loader = new ExternalPolicyLoader( | 452 external_loader = new ExternalPolicyLoader( |
| 453 ExtensionManagementFactory::GetForBrowserContext(profile), | 453 ExtensionManagementFactory::GetForBrowserContext(profile), |
| 454 ExternalPolicyLoader::FORCED); | 454 ExternalPolicyLoader::FORCED); |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 new ExternalProviderImpl( | 641 new ExternalProviderImpl( |
| 642 service, | 642 service, |
| 643 new ExternalComponentLoader(profile), | 643 new ExternalComponentLoader(profile), |
| 644 profile, | 644 profile, |
| 645 Manifest::INVALID_LOCATION, | 645 Manifest::INVALID_LOCATION, |
| 646 Manifest::EXTERNAL_COMPONENT, | 646 Manifest::EXTERNAL_COMPONENT, |
| 647 Extension::FROM_WEBSTORE | Extension::WAS_INSTALLED_BY_DEFAULT))); | 647 Extension::FROM_WEBSTORE | Extension::WAS_INSTALLED_BY_DEFAULT))); |
| 648 } | 648 } |
| 649 | 649 |
| 650 } // namespace extensions | 650 } // namespace extensions |
| OLD | NEW |