Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(721)

Side by Side Diff: chrome/browser/supervised_user/supervised_user_service.cc

Issue 545193003: Supervised users: Add a cmdline flag and about:flags entry to enable the host blacklist (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update histograms Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 base::Unretained(this))); 708 base::Unretained(this)));
709 pref_change_registrar_.Add(prefs::kSupervisedUserManualURLs, 709 pref_change_registrar_.Add(prefs::kSupervisedUserManualURLs,
710 base::Bind(&SupervisedUserService::UpdateManualURLs, 710 base::Bind(&SupervisedUserService::UpdateManualURLs,
711 base::Unretained(this))); 711 base::Unretained(this)));
712 712
713 // Initialize the filter. 713 // Initialize the filter.
714 OnDefaultFilteringBehaviorChanged(); 714 OnDefaultFilteringBehaviorChanged();
715 UpdateSiteLists(); 715 UpdateSiteLists();
716 UpdateManualHosts(); 716 UpdateManualHosts();
717 UpdateManualURLs(); 717 UpdateManualURLs();
718 if (delegate_) { 718 bool use_blacklist =
719 CommandLine::ForCurrentProcess()->HasSwitch(
720 switches::kEnableSupervisedUserBlacklist);
721 if (delegate_ && use_blacklist) {
719 base::FilePath blacklist_path = delegate_->GetBlacklistPath(); 722 base::FilePath blacklist_path = delegate_->GetBlacklistPath();
720 if (!blacklist_path.empty()) 723 if (!blacklist_path.empty())
721 LoadBlacklist(blacklist_path); 724 LoadBlacklist(blacklist_path);
722 } 725 }
723 726
724 #if !defined(OS_ANDROID) 727 #if !defined(OS_ANDROID)
725 // TODO(bauerb): Get rid of the platform-specific #ifdef here. 728 // TODO(bauerb): Get rid of the platform-specific #ifdef here.
726 // http://crbug.com/313377 729 // http://crbug.com/313377
727 BrowserList::AddObserver(this); 730 BrowserList::AddObserver(this);
728 #endif 731 #endif
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 // The active user can be NULL in unit tests. 850 // The active user can be NULL in unit tests.
848 if (user_manager::UserManager::Get()->GetActiveUser()) { 851 if (user_manager::UserManager::Get()->GetActiveUser()) {
849 return UTF16ToUTF8(user_manager::UserManager::Get()->GetUserDisplayName( 852 return UTF16ToUTF8(user_manager::UserManager::Get()->GetUserDisplayName(
850 user_manager::UserManager::Get()->GetActiveUser()->GetUserID())); 853 user_manager::UserManager::Get()->GetActiveUser()->GetUserID()));
851 } 854 }
852 return std::string(); 855 return std::string();
853 #else 856 #else
854 return profile_->GetPrefs()->GetString(prefs::kProfileName); 857 return profile_->GetPrefs()->GetString(prefs::kProfileName);
855 #endif 858 #endif
856 } 859 }
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698