OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/login/user_manager_impl.h" | 5 #include "chrome/browser/chromeos/login/user_manager_impl.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
716 device_local_account_policy_service_->AddObserver(this); | 716 device_local_account_policy_service_->AddObserver(this); |
717 } | 717 } |
718 CheckOwnership(); | 718 CheckOwnership(); |
719 RetrieveTrustedDevicePolicies(); | 719 RetrieveTrustedDevicePolicies(); |
720 break; | 720 break; |
721 case chrome::NOTIFICATION_PROFILE_ADDED: | 721 case chrome::NOTIFICATION_PROFILE_ADDED: |
722 if (IsUserLoggedIn() && !IsLoggedInAsGuest() && | 722 if (IsUserLoggedIn() && !IsLoggedInAsGuest() && |
723 !IsLoggedInAsLocallyManagedUser()) { | 723 !IsLoggedInAsLocallyManagedUser()) { |
724 Profile* profile = content::Source<Profile>(source).ptr(); | 724 Profile* profile = content::Source<Profile>(source).ptr(); |
725 if (!profile->IsOffTheRecord() && | 725 if (!profile->IsOffTheRecord() && |
726 // TODO(nkostylev): We should observe all logged in user's profiles. | |
727 profile == ProfileManager::GetDefaultProfile()) { | 726 profile == ProfileManager::GetDefaultProfile()) { |
728 DCHECK(NULL == observed_sync_service_); | 727 DCHECK(NULL == observed_sync_service_); |
729 observed_sync_service_ = | 728 observed_sync_service_ = |
730 ProfileSyncServiceFactory::GetForProfile(profile); | 729 ProfileSyncServiceFactory::GetForProfile(profile); |
731 if (observed_sync_service_) | 730 if (observed_sync_service_) |
732 observed_sync_service_->AddObserver(this); | 731 observed_sync_service_->AddObserver(this); |
733 } | 732 } |
734 } | 733 } |
735 break; | 734 break; |
736 case chrome::NOTIFICATION_SYSTEM_SETTING_CHANGED: | 735 case chrome::NOTIFICATION_SYSTEM_SETTING_CHANGED: |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1387 content::NotificationService::NoDetails()); | 1386 content::NotificationService::NoDetails()); |
1388 } | 1387 } |
1389 | 1388 |
1390 void UserManagerImpl::NotifyMergeSessionStateChanged() { | 1389 void UserManagerImpl::NotifyMergeSessionStateChanged() { |
1391 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1390 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
1392 FOR_EACH_OBSERVER(UserManager::Observer, observer_list_, | 1391 FOR_EACH_OBSERVER(UserManager::Observer, observer_list_, |
1393 MergeSessionStateChanged(merge_session_state_)); | 1392 MergeSessionStateChanged(merge_session_state_)); |
1394 } | 1393 } |
1395 | 1394 |
1396 } // namespace chromeos | 1395 } // namespace chromeos |
OLD | NEW |