| 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/chromeos/policy/device_local_account_policy_service.h" | 5 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 chromeos::CrosSettingsProvider::TrustedStatus status = | 416 chromeos::CrosSettingsProvider::TrustedStatus status = |
| 417 cros_settings_->PrepareTrustedValues( | 417 cros_settings_->PrepareTrustedValues( |
| 418 base::Bind(&DeviceLocalAccountPolicyService::UpdateAccountList, | 418 base::Bind(&DeviceLocalAccountPolicyService::UpdateAccountList, |
| 419 weak_factory_.GetWeakPtr())); | 419 weak_factory_.GetWeakPtr())); |
| 420 switch (status) { | 420 switch (status) { |
| 421 case chromeos::CrosSettingsProvider::TRUSTED: | 421 case chromeos::CrosSettingsProvider::TRUSTED: |
| 422 waiting_for_cros_settings_ = false; | 422 waiting_for_cros_settings_ = false; |
| 423 break; | 423 break; |
| 424 case chromeos::CrosSettingsProvider::TEMPORARILY_UNTRUSTED: | 424 case chromeos::CrosSettingsProvider::TEMPORARILY_UNTRUSTED: |
| 425 waiting_for_cros_settings_ = true; | 425 waiting_for_cros_settings_ = true; |
| 426 return; | 426 // Purposely break to allow initialization with temporarily untrusted |
| 427 // settings so that a crash-n-restart public session have its loader |
| 428 // properly registered as ExtensionService's external provider. |
| 429 break; |
| 427 case chromeos::CrosSettingsProvider::PERMANENTLY_UNTRUSTED: | 430 case chromeos::CrosSettingsProvider::PERMANENTLY_UNTRUSTED: |
| 428 waiting_for_cros_settings_ = false; | 431 waiting_for_cros_settings_ = false; |
| 429 return; | 432 return; |
| 430 } | 433 } |
| 431 | 434 |
| 432 // Update |policy_brokers_|, keeping existing entries. | 435 // Update |policy_brokers_|, keeping existing entries. |
| 433 PolicyBrokerMap old_policy_brokers; | 436 PolicyBrokerMap old_policy_brokers; |
| 434 policy_brokers_.swap(old_policy_brokers); | 437 policy_brokers_.swap(old_policy_brokers); |
| 435 std::set<std::string> subdirectories_to_keep; | 438 std::set<std::string> subdirectories_to_keep; |
| 436 const std::vector<DeviceLocalAccount> device_local_accounts = | 439 const std::vector<DeviceLocalAccount> device_local_accounts = |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 } | 563 } |
| 561 return nullptr; | 564 return nullptr; |
| 562 } | 565 } |
| 563 | 566 |
| 564 void DeviceLocalAccountPolicyService::NotifyPolicyUpdated( | 567 void DeviceLocalAccountPolicyService::NotifyPolicyUpdated( |
| 565 const std::string& user_id) { | 568 const std::string& user_id) { |
| 566 FOR_EACH_OBSERVER(Observer, observers_, OnPolicyUpdated(user_id)); | 569 FOR_EACH_OBSERVER(Observer, observers_, OnPolicyUpdated(user_id)); |
| 567 } | 570 } |
| 568 | 571 |
| 569 } // namespace policy | 572 } // namespace policy |
| OLD | NEW |