Commit 819d0544 authored by Mihai Sardarescu's avatar Mihai Sardarescu Committed by Commit Bot

[unity] Remove dependency on safe_browsing from //components/unified_consent

//components/safe_browsing depends on //content that is not build on iOS.
This means that //components/unified_consent cannot depend on
//components/safe_browsing as it needs to be build on iOS.

This CL removes the usage of safe_browsing from //components/unified_consent
and adds the corresponding method in the client.


Bug: NONE
Change-Id: I2c32629524d5621e36717dcb801fd8be00732a55
Reviewed-on: https://chromium-review.googlesource.com/1113753Reviewed-by: default avatarThomas Tangl <tangltom@chromium.org>
Commit-Queue: Mihai Sardarescu <msarda@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570345}
parent e01d4c5d
...@@ -27,6 +27,11 @@ void ChromeUnifiedConsentServiceClient::SetSearchSuggestEnabled(bool enabled) { ...@@ -27,6 +27,11 @@ void ChromeUnifiedConsentServiceClient::SetSearchSuggestEnabled(bool enabled) {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
} }
void ChromeUnifiedConsentServiceClient::SetSafeBrowsingEnabled(bool enabled) {
// TODO(http://crbug.com/800974): Implement this method.
NOTIMPLEMENTED();
}
void ChromeUnifiedConsentServiceClient::SetSafeBrowsingExtendedReportingEnabled( void ChromeUnifiedConsentServiceClient::SetSafeBrowsingExtendedReportingEnabled(
bool enabled) { bool enabled) {
// TODO(http://crbug.com/800974): Implement this method. // TODO(http://crbug.com/800974): Implement this method.
......
...@@ -12,12 +12,13 @@ class PrefService; ...@@ -12,12 +12,13 @@ class PrefService;
class ChromeUnifiedConsentServiceClient : public UnifiedConsentServiceClient { class ChromeUnifiedConsentServiceClient : public UnifiedConsentServiceClient {
public: public:
ChromeUnifiedConsentServiceClient(PrefService* pref_service); explicit ChromeUnifiedConsentServiceClient(PrefService* pref_service);
~ChromeUnifiedConsentServiceClient() override = default; ~ChromeUnifiedConsentServiceClient() override = default;
void SetAlternateErrorPagesEnabled(bool enabled) override; void SetAlternateErrorPagesEnabled(bool enabled) override;
void SetMetricsReportingEnabled(bool enabled) override; void SetMetricsReportingEnabled(bool enabled) override;
void SetSearchSuggestEnabled(bool enabled) override; void SetSearchSuggestEnabled(bool enabled) override;
void SetSafeBrowsingEnabled(bool enabled) override;
void SetSafeBrowsingExtendedReportingEnabled(bool enabled) override; void SetSafeBrowsingExtendedReportingEnabled(bool enabled) override;
void SetNetworkPredictionEnabled(bool enabled) override; void SetNetworkPredictionEnabled(bool enabled) override;
......
...@@ -15,7 +15,6 @@ static_library("unified_consent") { ...@@ -15,7 +15,6 @@ static_library("unified_consent") {
"//components/autofill/core/common", "//components/autofill/core/common",
"//components/browser_sync", "//components/browser_sync",
"//components/pref_registry", "//components/pref_registry",
"//components/safe_browsing",
"//components/signin/core/browser", "//components/signin/core/browser",
"//components/sync", "//components/sync",
"//services/identity/public/cpp", "//services/identity/public/cpp",
......
...@@ -4,7 +4,6 @@ include_rules = [ ...@@ -4,7 +4,6 @@ include_rules = [
"+components/keyed_service/core", "+components/keyed_service/core",
"+components/pref_registry", "+components/pref_registry",
"+components/prefs", "+components/prefs",
"+components/safe_browsing/common",
"+components/sync/base", "+components/sync/base",
"+services/identity/public/cpp", "+services/identity/public/cpp",
] ]
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "components/pref_registry/pref_registry_syncable.h" #include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_change_registrar.h" #include "components/prefs/pref_change_registrar.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "components/safe_browsing/common/safe_browsing_prefs.h"
#include "components/sync/base/model_type.h" #include "components/sync/base/model_type.h"
#include "components/unified_consent/pref_names.h" #include "components/unified_consent/pref_names.h"
#include "components/unified_consent/unified_consent_service_client.h" #include "components/unified_consent/unified_consent_service_client.h"
...@@ -83,11 +82,11 @@ void UnifiedConsentService::OnUnifiedConsentGivenPrefChanged() { ...@@ -83,11 +82,11 @@ void UnifiedConsentService::OnUnifiedConsentGivenPrefChanged() {
syncer::UserSelectableTypes()); syncer::UserSelectableTypes());
// Enable all non-personalized services. // Enable all non-personalized services.
pref_service_->SetBoolean(prefs::kSafeBrowsingEnabled, true);
service_client_->SetAlternateErrorPagesEnabled(true); service_client_->SetAlternateErrorPagesEnabled(true);
service_client_->SetMetricsReportingEnabled(true); service_client_->SetMetricsReportingEnabled(true);
service_client_->SetSafeBrowsingExtendedReportingEnabled(true); service_client_->SetSafeBrowsingExtendedReportingEnabled(true);
service_client_->SetSearchSuggestEnabled(true); service_client_->SetSearchSuggestEnabled(true);
service_client_->SetSafeBrowsingEnabled(true);
service_client_->SetSafeBrowsingExtendedReportingEnabled(true); service_client_->SetSafeBrowsingExtendedReportingEnabled(true);
service_client_->SetNetworkPredictionEnabled(true); service_client_->SetNetworkPredictionEnabled(true);
} }
...@@ -15,6 +15,8 @@ class UnifiedConsentServiceClient { ...@@ -15,6 +15,8 @@ class UnifiedConsentServiceClient {
virtual void SetMetricsReportingEnabled(bool enabled) = 0; virtual void SetMetricsReportingEnabled(bool enabled) = 0;
// Enables/disables search suggestions. // Enables/disables search suggestions.
virtual void SetSearchSuggestEnabled(bool enabled) = 0; virtual void SetSearchSuggestEnabled(bool enabled) = 0;
// Enables/disables safe browsing.
virtual void SetSafeBrowsingEnabled(bool enabled) = 0;
// Enables/disables extended safe browsing. // Enables/disables extended safe browsing.
virtual void SetSafeBrowsingExtendedReportingEnabled(bool enabled) = 0; virtual void SetSafeBrowsingExtendedReportingEnabled(bool enabled) = 0;
// Enables/disables prediction of network actions. // Enables/disables prediction of network actions.
......
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