| 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 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 const std::string& username) { | 553 const std::string& username) { |
| 554 DCHECK(!sync_processor_); | 554 DCHECK(!sync_processor_); |
| 555 | 555 |
| 556 // Clear all data on signout, to avoid supervised users from one custodian | 556 // Clear all data on signout, to avoid supervised users from one custodian |
| 557 // appearing in another one's profile. | 557 // appearing in another one's profile. |
| 558 prefs_->ClearPref(prefs::kSupervisedUsers); | 558 prefs_->ClearPref(prefs::kSupervisedUsers); |
| 559 } | 559 } |
| 560 | 560 |
| 561 void SupervisedUserSyncService::NotifySupervisedUserAcknowledged( | 561 void SupervisedUserSyncService::NotifySupervisedUserAcknowledged( |
| 562 const std::string& supervised_user_id) { | 562 const std::string& supervised_user_id) { |
| 563 FOR_EACH_OBSERVER(SupervisedUserSyncServiceObserver, observers_, | 563 for (SupervisedUserSyncServiceObserver& observer : observers_) |
| 564 OnSupervisedUserAcknowledged(supervised_user_id)); | 564 observer.OnSupervisedUserAcknowledged(supervised_user_id); |
| 565 } | 565 } |
| 566 | 566 |
| 567 void SupervisedUserSyncService::NotifySupervisedUsersSyncingStopped() { | 567 void SupervisedUserSyncService::NotifySupervisedUsersSyncingStopped() { |
| 568 FOR_EACH_OBSERVER(SupervisedUserSyncServiceObserver, observers_, | 568 for (SupervisedUserSyncServiceObserver& observer : observers_) |
| 569 OnSupervisedUsersSyncingStopped()); | 569 observer.OnSupervisedUsersSyncingStopped(); |
| 570 } | 570 } |
| 571 | 571 |
| 572 void SupervisedUserSyncService::NotifySupervisedUsersChanged() { | 572 void SupervisedUserSyncService::NotifySupervisedUsersChanged() { |
| 573 FOR_EACH_OBSERVER(SupervisedUserSyncServiceObserver, | 573 for (SupervisedUserSyncServiceObserver& observer : observers_) |
| 574 observers_, | 574 observer.OnSupervisedUsersChanged(); |
| 575 OnSupervisedUsersChanged()); | |
| 576 } | 575 } |
| 577 | 576 |
| 578 void SupervisedUserSyncService::DispatchCallbacks() { | 577 void SupervisedUserSyncService::DispatchCallbacks() { |
| 579 const base::DictionaryValue* supervised_users = | 578 const base::DictionaryValue* supervised_users = |
| 580 prefs_->GetDictionary(prefs::kSupervisedUsers); | 579 prefs_->GetDictionary(prefs::kSupervisedUsers); |
| 581 for (const auto& callback : callbacks_) | 580 for (const auto& callback : callbacks_) |
| 582 callback.Run(supervised_users); | 581 callback.Run(supervised_users); |
| 583 callbacks_.clear(); | 582 callbacks_.clear(); |
| 584 } | 583 } |
| OLD | NEW |