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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 whitelists_ = site_lists; | 748 whitelists_ = site_lists; |
749 url_filter_.LoadWhitelists(site_lists); | 749 url_filter_.LoadWhitelists(site_lists); |
750 } | 750 } |
751 | 751 |
752 void SupervisedUserService::LoadBlacklist(const base::FilePath& path, | 752 void SupervisedUserService::LoadBlacklist(const base::FilePath& path, |
753 const GURL& url) { | 753 const GURL& url) { |
754 DCHECK(blacklist_state_ == BlacklistLoadState::NOT_LOADED); | 754 DCHECK(blacklist_state_ == BlacklistLoadState::NOT_LOADED); |
755 blacklist_state_ = BlacklistLoadState::LOAD_STARTED; | 755 blacklist_state_ = BlacklistLoadState::LOAD_STARTED; |
756 base::PostTaskWithTraitsAndReplyWithResult( | 756 base::PostTaskWithTraitsAndReplyWithResult( |
757 FROM_HERE, | 757 FROM_HERE, |
758 base::TaskTraits() | 758 {base::MayBlock(), base::TaskPriority::BACKGROUND, |
759 .MayBlock() | 759 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, |
760 .WithPriority(base::TaskPriority::BACKGROUND) | |
761 .WithShutdownBehavior( | |
762 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN), | |
763 base::BindOnce(&base::PathExists, path), | 760 base::BindOnce(&base::PathExists, path), |
764 base::BindOnce(&SupervisedUserService::OnBlacklistFileChecked, | 761 base::BindOnce(&SupervisedUserService::OnBlacklistFileChecked, |
765 weak_ptr_factory_.GetWeakPtr(), path, url)); | 762 weak_ptr_factory_.GetWeakPtr(), path, url)); |
766 } | 763 } |
767 | 764 |
768 void SupervisedUserService::OnBlacklistFileChecked(const base::FilePath& path, | 765 void SupervisedUserService::OnBlacklistFileChecked(const base::FilePath& path, |
769 const GURL& url, | 766 const GURL& url, |
770 bool file_exists) { | 767 bool file_exists) { |
771 DCHECK(blacklist_state_ == BlacklistLoadState::LOAD_STARTED); | 768 DCHECK(blacklist_state_ == BlacklistLoadState::LOAD_STARTED); |
772 if (file_exists) { | 769 if (file_exists) { |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1210 base::RecordAction(UserMetricsAction("ManagedUsers_SwitchProfile")); | 1207 base::RecordAction(UserMetricsAction("ManagedUsers_SwitchProfile")); |
1211 | 1208 |
1212 is_profile_active_ = profile_became_active; | 1209 is_profile_active_ = profile_became_active; |
1213 } | 1210 } |
1214 #endif // !defined(OS_ANDROID) | 1211 #endif // !defined(OS_ANDROID) |
1215 | 1212 |
1216 void SupervisedUserService::OnSiteListUpdated() { | 1213 void SupervisedUserService::OnSiteListUpdated() { |
1217 for (SupervisedUserServiceObserver& observer : observer_list_) | 1214 for (SupervisedUserServiceObserver& observer : observer_list_) |
1218 observer.OnURLFilterChanged(); | 1215 observer.OnURLFilterChanged(); |
1219 } | 1216 } |
OLD | NEW |