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/supervised_user_service.h" | 5 #include "chrome/browser/supervised_user/supervised_user_service.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 | 844 |
845 FOR_EACH_OBSERVER( | 845 FOR_EACH_OBSERVER( |
846 SupervisedUserServiceObserver, observer_list_, OnURLFilterChanged()); | 846 SupervisedUserServiceObserver, observer_list_, OnURLFilterChanged()); |
847 } | 847 } |
848 | 848 |
849 std::string SupervisedUserService::GetSupervisedUserName() const { | 849 std::string SupervisedUserService::GetSupervisedUserName() const { |
850 #if defined(OS_CHROMEOS) | 850 #if defined(OS_CHROMEOS) |
851 // The active user can be NULL in unit tests. | 851 // The active user can be NULL in unit tests. |
852 if (user_manager::UserManager::Get()->GetActiveUser()) { | 852 if (user_manager::UserManager::Get()->GetActiveUser()) { |
853 return UTF16ToUTF8(user_manager::UserManager::Get()->GetUserDisplayName( | 853 return UTF16ToUTF8(user_manager::UserManager::Get()->GetUserDisplayName( |
854 user_manager::UserManager::Get()->GetActiveUser()->GetUserID())); | 854 user_manager::UserManager::Get()->GetActiveUser()->GetAccountId())); |
855 } | 855 } |
856 return std::string(); | 856 return std::string(); |
857 #else | 857 #else |
858 return profile_->GetPrefs()->GetString(prefs::kProfileName); | 858 return profile_->GetPrefs()->GetString(prefs::kProfileName); |
859 #endif | 859 #endif |
860 } | 860 } |
861 | 861 |
862 void SupervisedUserService::OnHistoryRecordingStateChanged() { | 862 void SupervisedUserService::OnHistoryRecordingStateChanged() { |
863 bool record_history = | 863 bool record_history = |
864 profile_->GetPrefs()->GetBoolean(prefs::kRecordHistory); | 864 profile_->GetPrefs()->GetBoolean(prefs::kRecordHistory); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
995 | 995 |
996 is_profile_active_ = profile_became_active; | 996 is_profile_active_ = profile_became_active; |
997 } | 997 } |
998 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) | 998 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) |
999 | 999 |
1000 void SupervisedUserService::OnSiteListUpdated() { | 1000 void SupervisedUserService::OnSiteListUpdated() { |
1001 FOR_EACH_OBSERVER( | 1001 FOR_EACH_OBSERVER( |
1002 SupervisedUserServiceObserver, observer_list_, OnURLFilterChanged()); | 1002 SupervisedUserServiceObserver, observer_list_, OnURLFilterChanged()); |
1003 } | 1003 } |
1004 | 1004 |
OLD | NEW |