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/login/login_utils.h" | 5 #include "chrome/browser/chromeos/login/login_utils.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 // would be executed after committing pending write on file thread. | 190 // would be executed after committing pending write on file thread. |
191 BrowserThread::PostTask( | 191 BrowserThread::PostTask( |
192 BrowserThread::FILE, FROM_HERE, | 192 BrowserThread::FILE, FROM_HERE, |
193 base::Bind(&JobRestartRequest::RestartJob, this)); | 193 base::Bind(&JobRestartRequest::RestartJob, this)); |
194 } else { | 194 } else { |
195 RestartJob(); | 195 RestartJob(); |
196 } | 196 } |
197 } | 197 } |
198 | 198 |
199 private: | 199 private: |
| 200 friend class base::RefCountedThreadSafe<JobRestartRequest>; |
| 201 |
| 202 ~JobRestartRequest() {} |
| 203 |
200 void RestartJob() { | 204 void RestartJob() { |
201 if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { | 205 if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
202 DBusThreadManager::Get()->GetSessionManagerClient()->RestartJob( | 206 DBusThreadManager::Get()->GetSessionManagerClient()->RestartJob( |
203 pid_, command_line_); | 207 pid_, command_line_); |
204 } else { | 208 } else { |
205 // This function can be called on FILE thread. See PostTask in the | 209 // This function can be called on FILE thread. See PostTask in the |
206 // constructor. | 210 // constructor. |
207 BrowserThread::PostTask( | 211 BrowserThread::PostTask( |
208 BrowserThread::UI, FROM_HERE, | 212 BrowserThread::UI, FROM_HERE, |
209 base::Bind(&JobRestartRequest::RestartJob, this)); | 213 base::Bind(&JobRestartRequest::RestartJob, this)); |
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1114 bool LoginUtils::IsWhitelisted(const std::string& username) { | 1118 bool LoginUtils::IsWhitelisted(const std::string& username) { |
1115 CrosSettings* cros_settings = CrosSettings::Get(); | 1119 CrosSettings* cros_settings = CrosSettings::Get(); |
1116 bool allow_new_user = false; | 1120 bool allow_new_user = false; |
1117 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 1121 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
1118 if (allow_new_user) | 1122 if (allow_new_user) |
1119 return true; | 1123 return true; |
1120 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); | 1124 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); |
1121 } | 1125 } |
1122 | 1126 |
1123 } // namespace chromeos | 1127 } // namespace chromeos |
OLD | NEW |