Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Side by Side Diff: chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc

Issue 2907493002: ChromeOS: Per-user time zone: refactor tests first. (Closed)
Patch Set: Fix debug build Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/chromeos/login/users/chrome_user_manager_impl.h" 5 #include "chrome/browser/chromeos/login/users/chrome_user_manager_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cstddef> 9 #include <cstddef>
10 #include <set> 10 #include <set>
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 enterprise_user_session_metrics::RegisterPrefs(registry); 187 enterprise_user_session_metrics::RegisterPrefs(registry);
188 } 188 }
189 189
190 // static 190 // static
191 std::unique_ptr<ChromeUserManager> 191 std::unique_ptr<ChromeUserManager>
192 ChromeUserManagerImpl::CreateChromeUserManager() { 192 ChromeUserManagerImpl::CreateChromeUserManager() {
193 return std::unique_ptr<ChromeUserManager>(new ChromeUserManagerImpl()); 193 return std::unique_ptr<ChromeUserManager>(new ChromeUserManagerImpl());
194 } 194 }
195 195
196 ChromeUserManagerImpl::ChromeUserManagerImpl() 196 ChromeUserManagerImpl::ChromeUserManagerImpl()
197 : ChromeUserManager(base::ThreadTaskRunnerHandle::Get()), 197 : ChromeUserManager(base::ThreadTaskRunnerHandle::IsSet()
198 ? base::ThreadTaskRunnerHandle::Get()
199 : scoped_refptr<base::TaskRunner>()),
198 cros_settings_(CrosSettings::Get()), 200 cros_settings_(CrosSettings::Get()),
199 device_local_account_policy_service_(NULL), 201 device_local_account_policy_service_(NULL),
200 supervised_user_manager_(new SupervisedUserManagerImpl(this)), 202 supervised_user_manager_(new SupervisedUserManagerImpl(this)),
201 bootstrap_manager_(new BootstrapManager(this)), 203 bootstrap_manager_(new BootstrapManager(this)),
202 weak_factory_(this) { 204 weak_factory_(this) {
203 UpdateNumberOfUsers(); 205 UpdateNumberOfUsers();
204 206
205 // UserManager instance should be used only on UI thread. 207 // UserManager instance should be used only on UI thread.
206 DCHECK_CURRENTLY_ON(BrowserThread::UI); 208 // (or in unit tests)
209 if (base::ThreadTaskRunnerHandle::IsSet())
210 DCHECK_CURRENTLY_ON(BrowserThread::UI);
211
207 registrar_.Add(this, 212 registrar_.Add(this,
208 chrome::NOTIFICATION_OWNERSHIP_STATUS_CHANGED, 213 chrome::NOTIFICATION_OWNERSHIP_STATUS_CHANGED,
209 content::NotificationService::AllSources()); 214 content::NotificationService::AllSources());
210 registrar_.Add(this, 215 registrar_.Add(this,
211 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, 216 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED,
212 content::NotificationService::AllSources()); 217 content::NotificationService::AllSources());
213 registrar_.Add(this, 218 registrar_.Add(this,
214 chrome::NOTIFICATION_PROFILE_CREATED, 219 chrome::NOTIFICATION_PROFILE_CREATED,
215 content::NotificationService::AllSources()); 220 content::NotificationService::AllSources());
216 221
(...skipping 1167 matching lines...) Expand 10 before | Expand all | Expand 10 after
1384 break; 1389 break;
1385 default: 1390 default:
1386 NOTREACHED(); 1391 NOTREACHED();
1387 break; 1392 break;
1388 } 1393 }
1389 1394
1390 return user; 1395 return user;
1391 } 1396 }
1392 1397
1393 } // namespace chromeos 1398 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698