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/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
9 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
10 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
11 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
12 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/profiles/profile_info_cache.h" | 15 #include "chrome/browser/profiles/profile_info_cache.h" |
15 #include "chrome/browser/profiles/profile_manager.h" | 16 #include "chrome/browser/profiles/profile_manager.h" |
16 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 17 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
17 #include "chrome/browser/signin/signin_manager_factory.h" | 18 #include "chrome/browser/signin/signin_manager_factory.h" |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 base::Unretained(this))); | 708 base::Unretained(this))); |
708 pref_change_registrar_.Add(prefs::kSupervisedUserManualURLs, | 709 pref_change_registrar_.Add(prefs::kSupervisedUserManualURLs, |
709 base::Bind(&SupervisedUserService::UpdateManualURLs, | 710 base::Bind(&SupervisedUserService::UpdateManualURLs, |
710 base::Unretained(this))); | 711 base::Unretained(this))); |
711 | 712 |
712 // Initialize the filter. | 713 // Initialize the filter. |
713 OnDefaultFilteringBehaviorChanged(); | 714 OnDefaultFilteringBehaviorChanged(); |
714 UpdateSiteLists(); | 715 UpdateSiteLists(); |
715 UpdateManualHosts(); | 716 UpdateManualHosts(); |
716 UpdateManualURLs(); | 717 UpdateManualURLs(); |
| 718 if (delegate_) { |
| 719 base::FilePath blacklist_path = delegate_->GetBlacklistPath(); |
| 720 if (!blacklist_path.empty()) |
| 721 LoadBlacklist(blacklist_path); |
| 722 } |
717 | 723 |
718 #if !defined(OS_ANDROID) | 724 #if !defined(OS_ANDROID) |
719 // TODO(bauerb): Get rid of the platform-specific #ifdef here. | 725 // TODO(bauerb): Get rid of the platform-specific #ifdef here. |
720 // http://crbug.com/313377 | 726 // http://crbug.com/313377 |
721 BrowserList::AddObserver(this); | 727 BrowserList::AddObserver(this); |
722 #endif | 728 #endif |
723 } else { | 729 } else { |
724 permissions_creator_.reset(); | 730 permissions_creator_.reset(); |
725 | 731 |
726 pref_change_registrar_.Remove( | 732 pref_change_registrar_.Remove( |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 // The active user can be NULL in unit tests. | 847 // The active user can be NULL in unit tests. |
842 if (user_manager::UserManager::Get()->GetActiveUser()) { | 848 if (user_manager::UserManager::Get()->GetActiveUser()) { |
843 return UTF16ToUTF8(user_manager::UserManager::Get()->GetUserDisplayName( | 849 return UTF16ToUTF8(user_manager::UserManager::Get()->GetUserDisplayName( |
844 user_manager::UserManager::Get()->GetActiveUser()->GetUserID())); | 850 user_manager::UserManager::Get()->GetActiveUser()->GetUserID())); |
845 } | 851 } |
846 return std::string(); | 852 return std::string(); |
847 #else | 853 #else |
848 return profile_->GetPrefs()->GetString(prefs::kProfileName); | 854 return profile_->GetPrefs()->GetString(prefs::kProfileName); |
849 #endif | 855 #endif |
850 } | 856 } |
OLD | NEW |