| 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. |
| 726 profile == ProfileManager::GetDefaultProfile()) { | 727 profile == ProfileManager::GetDefaultProfile()) { |
| 727 DCHECK(NULL == observed_sync_service_); | 728 DCHECK(NULL == observed_sync_service_); |
| 728 observed_sync_service_ = | 729 observed_sync_service_ = |
| 729 ProfileSyncServiceFactory::GetForProfile(profile); | 730 ProfileSyncServiceFactory::GetForProfile(profile); |
| 730 if (observed_sync_service_) | 731 if (observed_sync_service_) |
| 731 observed_sync_service_->AddObserver(this); | 732 observed_sync_service_->AddObserver(this); |
| 732 } | 733 } |
| 733 } | 734 } |
| 734 break; | 735 break; |
| 735 case chrome::NOTIFICATION_SYSTEM_SETTING_CHANGED: | 736 case chrome::NOTIFICATION_SYSTEM_SETTING_CHANGED: |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1386 content::NotificationService::NoDetails()); | 1387 content::NotificationService::NoDetails()); |
| 1387 } | 1388 } |
| 1388 | 1389 |
| 1389 void UserManagerImpl::NotifyMergeSessionStateChanged() { | 1390 void UserManagerImpl::NotifyMergeSessionStateChanged() { |
| 1390 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1391 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 1391 FOR_EACH_OBSERVER(UserManager::Observer, observer_list_, | 1392 FOR_EACH_OBSERVER(UserManager::Observer, observer_list_, |
| 1392 MergeSessionStateChanged(merge_session_state_)); | 1393 MergeSessionStateChanged(merge_session_state_)); |
| 1393 } | 1394 } |
| 1394 | 1395 |
| 1395 } // namespace chromeos | 1396 } // namespace chromeos |
| OLD | NEW |