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( ...@@ -132,7 +132,6 @@ void SupervisedUserNavigationObserver::OnRequestBlockedInternal(
sessions::ContentSerializedNavigationBuilder::FromNavigationEntry( sessions::ContentSerializedNavigationBuilder::FromNavigationEntry(
blocked_navigations_.size(), *entry)); blocked_navigations_.size(), *entry));
blocked_navigations_.push_back(std::move(serialized_entry)); blocked_navigations_.push_back(std::move(serialized_entry));
supervised_user_service_->DidBlockNavigation(web_contents());
// Show the interstitial. // Show the interstitial.
const bool initial_page_load = true; const bool initial_page_load = true;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include "base/feature_list.h" #include "base/feature_list.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/files/file_util.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/metrics/user_metrics.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
...@@ -77,10 +77,6 @@ using extensions::ExtensionRegistry; ...@@ -77,10 +77,6 @@ using extensions::ExtensionRegistry;
using extensions::ExtensionSystem; using extensions::ExtensionSystem;
#endif #endif
#if BUILDFLAG(ENABLE_EXTENSIONS)
using extensions::ExtensionPrefs;
#endif
namespace { namespace {
// The URL from which to download a host blacklist if no local one exists yet. // 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) { ...@@ -337,17 +333,6 @@ void SupervisedUserService::InitSync(const std::string& refresh_token) {
} }
#endif // !defined(OS_ANDROID) #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( void SupervisedUserService::AddObserver(
SupervisedUserServiceObserver* observer) { SupervisedUserServiceObserver* observer) {
observer_list_.AddObserver(observer); observer_list_.AddObserver(observer);
...@@ -734,20 +719,6 @@ void SupervisedUserService::UpdateManualURLs() { ...@@ -734,20 +719,6 @@ void SupervisedUserService::UpdateManualURLs() {
observer.OnURLFilterChanged(); 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() { void SupervisedUserService::OnForceSessionSyncChanged() {
includes_sync_sessions_type_ = includes_sync_sessions_type_ =
profile_->GetPrefs()->GetBoolean(prefs::kForceSessionSync); profile_->GetPrefs()->GetBoolean(prefs::kForceSessionSync);
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include "components/prefs/pref_change_registrar.h" #include "components/prefs/pref_change_registrar.h"
#include "components/sync/driver/sync_type_preference_provider.h" #include "components/sync/driver/sync_type_preference_provider.h"
#include "extensions/buildflags/buildflags.h" #include "extensions/buildflags/buildflags.h"
#include "net/url_request/url_request_context_getter.h"
#if BUILDFLAG(ENABLE_EXTENSIONS) #if BUILDFLAG(ENABLE_EXTENSIONS)
#include "extensions/browser/extension_registry_observer.h" #include "extensions/browser/extension_registry_observer.h"
...@@ -37,7 +36,6 @@ ...@@ -37,7 +36,6 @@
#endif #endif
class Browser; class Browser;
class GoogleServiceAuthError;
class PermissionRequestCreator; class PermissionRequestCreator;
class Profile; class Profile;
class SupervisedUserServiceObserver; class SupervisedUserServiceObserver;
...@@ -51,10 +49,6 @@ class FilePath; ...@@ -51,10 +49,6 @@ class FilePath;
class Version; class Version;
} }
namespace content {
class WebContents;
}
namespace extensions { namespace extensions {
class ExtensionRegistry; class ExtensionRegistry;
} }
...@@ -77,10 +71,6 @@ class SupervisedUserService : public KeyedService, ...@@ -77,10 +71,6 @@ class SupervisedUserService : public KeyedService,
#endif #endif
public SupervisedUserURLFilter::Observer { public SupervisedUserURLFilter::Observer {
public: public:
using NavigationBlockedCallback =
base::RepeatingCallback<void(content::WebContents*)>;
using AuthErrorCallback =
base::OnceCallback<void(const GoogleServiceAuthError&)>;
using SuccessCallback = base::OnceCallback<void(bool)>; using SuccessCallback = base::OnceCallback<void(bool)>;
class Delegate { class Delegate {
...@@ -171,9 +161,6 @@ class SupervisedUserService : public KeyedService, ...@@ -171,9 +161,6 @@ class SupervisedUserService : public KeyedService,
void InitSync(const std::string& refresh_token); void InitSync(const std::string& refresh_token);
#endif #endif
void AddNavigationBlockedCallback(const NavigationBlockedCallback& callback);
void DidBlockNavigation(content::WebContents* web_contents);
void AddObserver(SupervisedUserServiceObserver* observer); void AddObserver(SupervisedUserServiceObserver* observer);
void RemoveObserver(SupervisedUserServiceObserver* observer); void RemoveObserver(SupervisedUserServiceObserver* observer);
...@@ -204,8 +191,6 @@ class SupervisedUserService : public KeyedService, ...@@ -204,8 +191,6 @@ class SupervisedUserService : public KeyedService,
private: private:
friend class SupervisedUserServiceExtensionTestBase; friend class SupervisedUserServiceExtensionTestBase;
friend class SupervisedUserServiceFactory; friend class SupervisedUserServiceFactory;
FRIEND_TEST_ALL_PREFIXES(SingleClientSupervisedUserSettingsSyncTest, Sanity);
FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, ClearOmitOnRegistration);
FRIEND_TEST_ALL_PREFIXES( FRIEND_TEST_ALL_PREFIXES(
SupervisedUserServiceExtensionTest, SupervisedUserServiceExtensionTest,
ExtensionManagementPolicyProviderWithoutSUInitiatedInstalls); ExtensionManagementPolicyProviderWithoutSUInitiatedInstalls);
...@@ -323,9 +308,6 @@ class SupervisedUserService : public KeyedService, ...@@ -323,9 +308,6 @@ class SupervisedUserService : public KeyedService,
// corresponding preference is changed. // corresponding preference is changed.
void UpdateManualURLs(); void UpdateManualURLs();
// Returns the human readable name of the supervised user.
std::string GetSupervisedUserName() const;
// Subscribes to the SupervisedUserPrefStore, refreshes // Subscribes to the SupervisedUserPrefStore, refreshes
// |includes_sync_sessions_type_| and triggers reconfiguring the // |includes_sync_sessions_type_| and triggers reconfiguring the
// ProfileSyncService. // ProfileSyncService.
...@@ -347,8 +329,6 @@ class SupervisedUserService : public KeyedService, ...@@ -347,8 +329,6 @@ class SupervisedUserService : public KeyedService,
bool is_profile_active_; bool is_profile_active_;
std::vector<NavigationBlockedCallback> navigation_blocked_callbacks_;
// True only when |Init()| method has been called. // True only when |Init()| method has been called.
bool did_init_; 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