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/supervised_user/legacy/supervised_user_sync_service.h" | 5 #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 544 break; | 544 break; |
| 545 } | 545 } |
| 546 } | 546 } |
| 547 } | 547 } |
| 548 return error; | 548 return error; |
| 549 } | 549 } |
| 550 | 550 |
| 551 void SupervisedUserSyncService::GoogleSignedOut( | 551 void SupervisedUserSyncService::GoogleSignedOut( |
| 552 const std::string& account_id, | 552 const std::string& account_id, |
| 553 const std::string& username) { | 553 const std::string& username) { |
| 554 DCHECK(!sync_processor_); | |
|
Marc Treib
2016/11/22 09:05:59
Why this change?
pavely
2016/11/22 19:17:52
GoogleSignedOut is called synchronously to both Pr
Marc Treib
2016/11/23 09:16:14
Thanks for the explanation!
| |
| 555 | |
| 556 // Clear all data on signout, to avoid supervised users from one custodian | 554 // Clear all data on signout, to avoid supervised users from one custodian |
| 557 // appearing in another one's profile. | 555 // appearing in another one's profile. |
| 558 prefs_->ClearPref(prefs::kSupervisedUsers); | 556 prefs_->ClearPref(prefs::kSupervisedUsers); |
| 559 } | 557 } |
| 560 | 558 |
| 561 void SupervisedUserSyncService::NotifySupervisedUserAcknowledged( | 559 void SupervisedUserSyncService::NotifySupervisedUserAcknowledged( |
| 562 const std::string& supervised_user_id) { | 560 const std::string& supervised_user_id) { |
| 563 for (SupervisedUserSyncServiceObserver& observer : observers_) | 561 for (SupervisedUserSyncServiceObserver& observer : observers_) |
| 564 observer.OnSupervisedUserAcknowledged(supervised_user_id); | 562 observer.OnSupervisedUserAcknowledged(supervised_user_id); |
| 565 } | 563 } |
| 566 | 564 |
| 567 void SupervisedUserSyncService::NotifySupervisedUsersSyncingStopped() { | 565 void SupervisedUserSyncService::NotifySupervisedUsersSyncingStopped() { |
| 568 for (SupervisedUserSyncServiceObserver& observer : observers_) | 566 for (SupervisedUserSyncServiceObserver& observer : observers_) |
| 569 observer.OnSupervisedUsersSyncingStopped(); | 567 observer.OnSupervisedUsersSyncingStopped(); |
| 570 } | 568 } |
| 571 | 569 |
| 572 void SupervisedUserSyncService::NotifySupervisedUsersChanged() { | 570 void SupervisedUserSyncService::NotifySupervisedUsersChanged() { |
| 573 for (SupervisedUserSyncServiceObserver& observer : observers_) | 571 for (SupervisedUserSyncServiceObserver& observer : observers_) |
| 574 observer.OnSupervisedUsersChanged(); | 572 observer.OnSupervisedUsersChanged(); |
| 575 } | 573 } |
| 576 | 574 |
| 577 void SupervisedUserSyncService::DispatchCallbacks() { | 575 void SupervisedUserSyncService::DispatchCallbacks() { |
| 578 const base::DictionaryValue* supervised_users = | 576 const base::DictionaryValue* supervised_users = |
| 579 prefs_->GetDictionary(prefs::kSupervisedUsers); | 577 prefs_->GetDictionary(prefs::kSupervisedUsers); |
| 580 for (const auto& callback : callbacks_) | 578 for (const auto& callback : callbacks_) |
| 581 callback.Run(supervised_users); | 579 callback.Run(supervised_users); |
| 582 callbacks_.clear(); | 580 callbacks_.clear(); |
| 583 } | 581 } |
| OLD | NEW |