Commit 9d91df55 authored by Marc Treib's avatar Marc Treib Committed by Commit Bot

Remove some dead code in SupervisedUserService

Bug: none
Change-Id: I9a1bd69329e187e39d82edb20c913d947fd9b588
Reviewed-on: https://chromium-review.googlesource.com/1249069Reviewed-by: default avatarMohamed Amir Yosef <mamir@chromium.org>
Commit-Queue: Marc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594720}
parent dea06809
......@@ -132,7 +132,6 @@ void SupervisedUserNavigationObserver::OnRequestBlockedInternal(
sessions::ContentSerializedNavigationBuilder::FromNavigationEntry(
blocked_navigations_.size(), *entry));
blocked_navigations_.push_back(std::move(serialized_entry));
supervised_user_service_->DidBlockNavigation(web_contents());
// Show the interstitial.
const bool initial_page_load = true;
......
......@@ -9,7 +9,7 @@
#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_refptr.h"
#include "base/metrics/user_metrics.h"
#include "base/path_service.h"
#include "base/strings/stringprintf.h"
......@@ -77,10 +77,6 @@ using extensions::ExtensionRegistry;
using extensions::ExtensionSystem;
#endif
#if BUILDFLAG(ENABLE_EXTENSIONS)
using extensions::ExtensionPrefs;
#endif
namespace {
// The URL from which to download a host blacklist if no local one exists yet.
......@@ -337,17 +333,6 @@ void SupervisedUserService::InitSync(const std::string& refresh_token) {
}
#endif // !defined(OS_ANDROID)
void SupervisedUserService::AddNavigationBlockedCallback(
const NavigationBlockedCallback& callback) {
navigation_blocked_callbacks_.push_back(callback);
}
void SupervisedUserService::DidBlockNavigation(
content::WebContents* web_contents) {
for (const auto& callback : navigation_blocked_callbacks_)
callback.Run(web_contents);
}
void SupervisedUserService::AddObserver(
SupervisedUserServiceObserver* observer) {
observer_list_.AddObserver(observer);
......@@ -734,20 +719,6 @@ void SupervisedUserService::UpdateManualURLs() {
observer.OnURLFilterChanged();
}
std::string SupervisedUserService::GetSupervisedUserName() const {
#if defined(OS_CHROMEOS)
// The active user can be NULL in unit tests.
if (user_manager::UserManager::Get()->GetActiveUser()) {
return base::UTF16ToUTF8(
user_manager::UserManager::Get()->GetUserDisplayName(
user_manager::UserManager::Get()->GetActiveUser()->GetAccountId()));
}
return std::string();
#else
return profile_->GetPrefs()->GetString(prefs::kProfileName);
#endif
}
void SupervisedUserService::OnForceSessionSyncChanged() {
includes_sync_sessions_type_ =
profile_->GetPrefs()->GetBoolean(prefs::kForceSessionSync);
......
......@@ -29,7 +29,6 @@
#include "components/prefs/pref_change_registrar.h"
#include "components/sync/driver/sync_type_preference_provider.h"
#include "extensions/buildflags/buildflags.h"
#include "net/url_request/url_request_context_getter.h"
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "extensions/browser/extension_registry_observer.h"
......@@ -37,7 +36,6 @@
#endif
class Browser;
class GoogleServiceAuthError;
class PermissionRequestCreator;
class Profile;
class SupervisedUserServiceObserver;
......@@ -51,10 +49,6 @@ class FilePath;
class Version;
}
namespace content {
class WebContents;
}
namespace extensions {
class ExtensionRegistry;
}
......@@ -77,10 +71,6 @@ class SupervisedUserService : public KeyedService,
#endif
public SupervisedUserURLFilter::Observer {
public:
using NavigationBlockedCallback =
base::RepeatingCallback<void(content::WebContents*)>;
using AuthErrorCallback =
base::OnceCallback<void(const GoogleServiceAuthError&)>;
using SuccessCallback = base::OnceCallback<void(bool)>;
class Delegate {
......@@ -171,9 +161,6 @@ class SupervisedUserService : public KeyedService,
void InitSync(const std::string& refresh_token);
#endif
void AddNavigationBlockedCallback(const NavigationBlockedCallback& callback);
void DidBlockNavigation(content::WebContents* web_contents);
void AddObserver(SupervisedUserServiceObserver* observer);
void RemoveObserver(SupervisedUserServiceObserver* observer);
......@@ -204,8 +191,6 @@ class SupervisedUserService : public KeyedService,
private:
friend class SupervisedUserServiceExtensionTestBase;
friend class SupervisedUserServiceFactory;
FRIEND_TEST_ALL_PREFIXES(SingleClientSupervisedUserSettingsSyncTest, Sanity);
FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, ClearOmitOnRegistration);
FRIEND_TEST_ALL_PREFIXES(
SupervisedUserServiceExtensionTest,
ExtensionManagementPolicyProviderWithoutSUInitiatedInstalls);
......@@ -323,9 +308,6 @@ class SupervisedUserService : public KeyedService,
// corresponding preference is changed.
void UpdateManualURLs();
// Returns the human readable name of the supervised user.
std::string GetSupervisedUserName() const;
// Subscribes to the SupervisedUserPrefStore, refreshes
// |includes_sync_sessions_type_| and triggers reconfiguring the
// ProfileSyncService.
......@@ -347,8 +329,6 @@ class SupervisedUserService : public KeyedService,
bool is_profile_active_;
std::vector<NavigationBlockedCallback> navigation_blocked_callbacks_;
// True only when |Init()| method has been called.
bool did_init_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment