OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/policy_cert_service_factory.h" | 5 #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h" |
6 | 6 |
7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/chromeos/policy/policy_cert_service.h" | 9 #include "chrome/browser/chromeos/policy/policy_cert_service.h" |
10 #include "chrome/browser/chromeos/policy/policy_cert_verifier.h" | 10 #include "chrome/browser/chromeos/policy/policy_cert_verifier.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // TODO(joaodasilva): remove this, eventually. | 108 // TODO(joaodasilva): remove this, eventually. |
109 PrefService* prefs = profile->GetOriginalProfile()->GetPrefs(); | 109 PrefService* prefs = profile->GetOriginalProfile()->GetPrefs(); |
110 if (prefs->GetBoolean(prefs::kUsedPolicyCertificatesOnce)) { | 110 if (prefs->GetBoolean(prefs::kUsedPolicyCertificatesOnce)) { |
111 SetUsedPolicyCertificates(user->email()); | 111 SetUsedPolicyCertificates(user->email()); |
112 prefs->ClearPref(prefs::kUsedPolicyCertificatesOnce); | 112 prefs->ClearPref(prefs::kUsedPolicyCertificatesOnce); |
113 | 113 |
114 if (user_manager->GetLoggedInUsers().size() > 1u) { | 114 if (user_manager->GetLoggedInUsers().size() > 1u) { |
115 // This login should not have been allowed. After rebooting, local_state | 115 // This login should not have been allowed. After rebooting, local_state |
116 // will contain the updated list of users that used policy-pushed | 116 // will contain the updated list of users that used policy-pushed |
117 // certificates and this won't happen again. | 117 // certificates and this won't happen again. |
118 // Note that a user becomes logged in before his profile is created. | 118 // Note that a user becomes logged in before their profile is created. |
119 LOG(ERROR) << "Shutdown session because a tainted profile was added."; | 119 LOG(ERROR) << "Shutdown session because a tainted profile was added."; |
120 g_browser_process->local_state()->CommitPendingWrite(); | 120 g_browser_process->local_state()->CommitPendingWrite(); |
121 prefs->CommitPendingWrite(); | 121 prefs->CommitPendingWrite(); |
122 chrome::AttemptUserExit(); | 122 chrome::AttemptUserExit(); |
123 } | 123 } |
124 } | 124 } |
125 | 125 |
126 UserNetworkConfigurationUpdater* net_conf_updater = | 126 UserNetworkConfigurationUpdater* net_conf_updater = |
127 UserNetworkConfigurationUpdaterFactory::GetForProfile(profile); | 127 UserNetworkConfigurationUpdaterFactory::GetForProfile(profile); |
128 if (!net_conf_updater) | 128 if (!net_conf_updater) |
(...skipping 12 matching lines...) Expand all Loading... |
141 // TODO(joaodasilva): this is used for backwards compatibility. | 141 // TODO(joaodasilva): this is used for backwards compatibility. |
142 // Remove once it's not necessary anymore. | 142 // Remove once it's not necessary anymore. |
143 registry->RegisterBooleanPref(prefs::kUsedPolicyCertificatesOnce, false); | 143 registry->RegisterBooleanPref(prefs::kUsedPolicyCertificatesOnce, false); |
144 } | 144 } |
145 | 145 |
146 bool PolicyCertServiceFactory::ServiceIsNULLWhileTesting() const { | 146 bool PolicyCertServiceFactory::ServiceIsNULLWhileTesting() const { |
147 return true; | 147 return true; |
148 } | 148 } |
149 | 149 |
150 } // namespace policy | 150 } // namespace policy |
OLD | NEW |