Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extension_system_impl.h" | 5 #include "chrome/browser/extensions/extension_system_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 #if defined(ENABLE_NOTIFICATIONS) | 59 #if defined(ENABLE_NOTIFICATIONS) |
| 60 #include "chrome/browser/notifications/notifier_state_tracker.h" | 60 #include "chrome/browser/notifications/notifier_state_tracker.h" |
| 61 #include "chrome/browser/notifications/notifier_state_tracker_factory.h" | 61 #include "chrome/browser/notifications/notifier_state_tracker_factory.h" |
| 62 #include "ui/message_center/notifier_settings.h" | 62 #include "ui/message_center/notifier_settings.h" |
| 63 #endif | 63 #endif |
| 64 | 64 |
| 65 #if defined(OS_CHROMEOS) | 65 #if defined(OS_CHROMEOS) |
| 66 #include "chrome/browser/app_mode/app_mode_utils.h" | 66 #include "chrome/browser/app_mode/app_mode_utils.h" |
| 67 #include "chrome/browser/chromeos/app_mode/kiosk_app_update_install_gate.h" | 67 #include "chrome/browser/chromeos/app_mode/kiosk_app_update_install_gate.h" |
| 68 #include "chrome/browser/chromeos/extensions/device_local_account_management_pol icy_provider.h" | 68 #include "chrome/browser/chromeos/extensions/device_local_account_management_pol icy_provider.h" |
| 69 #include "chrome/browser/chromeos/extensions/signin_screen_policy_provider.h" | |
| 69 #include "chrome/browser/chromeos/policy/device_local_account.h" | 70 #include "chrome/browser/chromeos/policy/device_local_account.h" |
| 71 #include "chrome/browser/chromeos/profiles/profile_helper.h" | |
| 70 #include "chromeos/chromeos_switches.h" | 72 #include "chromeos/chromeos_switches.h" |
| 71 #include "chromeos/login/login_state.h" | 73 #include "chromeos/login/login_state.h" |
| 72 #include "components/user_manager/user.h" | 74 #include "components/user_manager/user.h" |
| 73 #include "components/user_manager/user_manager.h" | 75 #include "components/user_manager/user_manager.h" |
| 74 #endif | 76 #endif |
| 75 | 77 |
| 76 using content::BrowserThread; | 78 using content::BrowserThread; |
| 77 | 79 |
| 78 namespace extensions { | 80 namespace extensions { |
| 79 | 81 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 120 #if defined(OS_CHROMEOS) | 122 #if defined(OS_CHROMEOS) |
| 121 const user_manager::User* user = | 123 const user_manager::User* user = |
| 122 user_manager::UserManager::Get()->GetActiveUser(); | 124 user_manager::UserManager::Get()->GetActiveUser(); |
| 123 policy::DeviceLocalAccount::Type device_local_account_type; | 125 policy::DeviceLocalAccount::Type device_local_account_type; |
| 124 if (user && policy::IsDeviceLocalAccountUser(user->email(), | 126 if (user && policy::IsDeviceLocalAccountUser(user->email(), |
| 125 &device_local_account_type)) { | 127 &device_local_account_type)) { |
| 126 device_local_account_management_policy_provider_.reset( | 128 device_local_account_management_policy_provider_.reset( |
| 127 new chromeos::DeviceLocalAccountManagementPolicyProvider( | 129 new chromeos::DeviceLocalAccountManagementPolicyProvider( |
| 128 device_local_account_type)); | 130 device_local_account_type)); |
| 129 } | 131 } |
| 132 // We can not perform check for Signin Profile here, as it would result in | |
|
emaxx
2016/08/30 13:01:42
nit: Seems that the indentation was lost here.
Denis Kuznetsov (DE-MUC)
2016/09/01 17:28:57
Done.
| |
| 133 // recursive call upon creation of Signin Profile, so we will create | |
| 134 // SigninScreenPolicyProvider lazily in RegisterManagementPolicyProviders. | |
| 130 #endif // defined(OS_CHROMEOS) | 135 #endif // defined(OS_CHROMEOS) |
| 131 } | 136 } |
| 132 | 137 |
| 133 void ExtensionSystemImpl::Shared::RegisterManagementPolicyProviders() { | 138 void ExtensionSystemImpl::Shared::RegisterManagementPolicyProviders() { |
| 134 management_policy_->RegisterProviders( | 139 management_policy_->RegisterProviders( |
| 135 ExtensionManagementFactory::GetForBrowserContext(profile_) | 140 ExtensionManagementFactory::GetForBrowserContext(profile_) |
| 136 ->GetProviders()); | 141 ->GetProviders()); |
| 137 | 142 |
| 138 #if defined(OS_CHROMEOS) | 143 #if defined(OS_CHROMEOS) |
| 144 // Lazy creation of SigninScreenPolicyProvider | |
| 145 if (!signin_screen_policy_provider_) { | |
| 146 if (profile_ == | |
| 147 chromeos::ProfileHelper::GetSigninProfile()->GetOriginalProfile()) { | |
| 148 signin_screen_policy_provider_.reset( | |
| 149 new chromeos::SigninScreenPolicyProvider()); | |
| 150 } | |
| 151 } | |
| 152 | |
| 139 if (device_local_account_management_policy_provider_) { | 153 if (device_local_account_management_policy_provider_) { |
| 140 management_policy_->RegisterProvider( | 154 management_policy_->RegisterProvider( |
| 141 device_local_account_management_policy_provider_.get()); | 155 device_local_account_management_policy_provider_.get()); |
| 142 } | 156 } |
| 157 if (signin_screen_policy_provider_) { | |
| 158 management_policy_->RegisterProvider(signin_screen_policy_provider_.get()); | |
| 159 } | |
| 143 #endif // defined(OS_CHROMEOS) | 160 #endif // defined(OS_CHROMEOS) |
| 144 | 161 |
| 145 management_policy_->RegisterProvider(InstallVerifier::Get(profile_)); | 162 management_policy_->RegisterProvider(InstallVerifier::Get(profile_)); |
| 146 } | 163 } |
| 147 | 164 |
| 148 void ExtensionSystemImpl::Shared::InitInstallGates() { | 165 void ExtensionSystemImpl::Shared::InitInstallGates() { |
| 149 update_install_gate_.reset(new UpdateInstallGate(extension_service_.get())); | 166 update_install_gate_.reset(new UpdateInstallGate(extension_service_.get())); |
| 150 extension_service_->RegisterInstallGate( | 167 extension_service_->RegisterInstallGate( |
| 151 ExtensionPrefs::DELAY_REASON_WAIT_FOR_IDLE, update_install_gate_.get()); | 168 ExtensionPrefs::DELAY_REASON_WAIT_FOR_IDLE, update_install_gate_.get()); |
| 152 extension_service_->RegisterInstallGate( | 169 extension_service_->RegisterInstallGate( |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 467 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( | 484 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( |
| 468 const std::string& extension_id, | 485 const std::string& extension_id, |
| 469 const UnloadedExtensionInfo::Reason reason) { | 486 const UnloadedExtensionInfo::Reason reason) { |
| 470 BrowserThread::PostTask( | 487 BrowserThread::PostTask( |
| 471 BrowserThread::IO, | 488 BrowserThread::IO, |
| 472 FROM_HERE, | 489 FROM_HERE, |
| 473 base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason)); | 490 base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason)); |
| 474 } | 491 } |
| 475 | 492 |
| 476 } // namespace extensions | 493 } // namespace extensions |
| OLD | NEW |