Android build for ungoogled-chromium. https://uc.droidware.info
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

156 lines
9.1 KiB

From: Wengling Chen <[email protected]>
Date: Fri, 10 Jan 2020 18:01:56 -0500
Subject: Fix build error caused by the removal of safe_browsing_prefs.h
---
android_webview/browser/aw_browser_context.cc | 2 -
android_webview/browser/safe_browsing/aw_safe_browsing_blocking_page.cc | 10 ++---
chrome/android/BUILD.gn | 1
chrome/android/chrome_java_sources.gni | 1
chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SyncAndServicesSettings.java | 19 ++--------
chrome/browser/android/preferences/prefs.h | 2 -
weblayer/browser/browser_context_impl.cc | 2 -
7 files changed, 10 insertions(+), 27 deletions(-)
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -2914,7 +2914,6 @@ generate_jni("chrome_jni_headers") {
"java/src/org/chromium/chrome/browser/resources/ResourceMapper.java",
"java/src/org/chromium/chrome/browser/rlz/RevenueStats.java",
"java/src/org/chromium/chrome/browser/rlz/RlzPingHandler.java",
- "java/src/org/chromium/chrome/browser/safe_browsing/SafeBrowsingBridge.java",
"java/src/org/chromium/chrome/browser/safe_browsing/SafeBrowsingPasswordReuseDialogBridge.java",
"java/src/org/chromium/chrome/browser/screenshot/EditorScreenshotTask.java",
"java/src/org/chromium/chrome/browser/search_engines/TemplateUrlServiceFactory.java",
--- a/chrome/android/chrome_java_sources.gni
+++ b/chrome/android/chrome_java_sources.gni
@@ -1355,7 +1355,6 @@ chrome_java_sources = [
"java/src/org/chromium/chrome/browser/resources/ResourceMapper.java",
"java/src/org/chromium/chrome/browser/rlz/RevenueStats.java",
"java/src/org/chromium/chrome/browser/rlz/RlzPingHandler.java",
- "java/src/org/chromium/chrome/browser/safe_browsing/SafeBrowsingBridge.java",
"java/src/org/chromium/chrome/browser/safe_browsing/SafeBrowsingPasswordReuseDialogBridge.java",
"java/src/org/chromium/chrome/browser/screenshot/EditorScreenshotSource.java",
"java/src/org/chromium/chrome/browser/screenshot/EditorScreenshotTask.java",
--- a/android_webview/browser/aw_browser_context.cc
+++ b/android_webview/browser/aw_browser_context.cc
@@ -235,7 +235,7 @@ base::FilePath AwBrowserContext::GetCont
// static
void AwBrowserContext::RegisterPrefs(PrefRegistrySimple* registry) {
- safe_browsing::RegisterProfilePrefs(registry);
+ // safe_browsing::RegisterProfilePrefs(registry);
// Register the Autocomplete Data Retention Policy pref.
// The default value '0' represents the latest Chrome major version on which
--- a/android_webview/browser/safe_browsing/aw_safe_browsing_blocking_page.cc
+++ b/android_webview/browser/safe_browsing/aw_safe_browsing_blocking_page.cc
@@ -98,12 +98,12 @@ AwSafeBrowsingBlockingPage* AwSafeBrowsi
BaseSafeBrowsingErrorUI::SBErrorDisplayOptions display_options =
BaseSafeBrowsingErrorUI::SBErrorDisplayOptions(
IsMainPageLoadBlocked(unsafe_resources),
- safe_browsing::IsExtendedReportingOptInAllowed(*pref_service),
+ false,
browser_context->IsOffTheRecord(),
- safe_browsing::IsExtendedReportingEnabled(*pref_service),
- safe_browsing::IsExtendedReportingPolicyManaged(*pref_service),
- safe_browsing::IsEnhancedProtectionEnabled(*pref_service),
- pref_service->GetBoolean(::prefs::kSafeBrowsingProceedAnywayDisabled),
+ false,
+ false,
+ false,
+ false,
false, // should_open_links_in_new_tab
false, // always_show_back_to_safety
"cpn_safe_browsing_wv"); // help_center_article_link
--- a/chrome/browser/android/preferences/prefs.h
+++ b/chrome/browser/android/preferences/prefs.h
@@ -38,8 +38,6 @@ enum Pref {
AUTOFILL_CREDIT_CARD_ENABLED,
USAGE_STATS_ENABLED,
OFFLINE_PREFETCH_USER_SETTING_ENABLED,
- SAFE_BROWSING_EXTENDED_REPORTING_OPT_IN_ALLOWED,
- SAFE_BROWSING_ENABLED,
PASSWORD_MANAGER_ONBOARDING_STATE,
SEARCH_SUGGEST_ENABLED,
REMEMBER_PASSWORDS_ENABLED,
--- a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SyncAndServicesSettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SyncAndServicesSettings.java
@@ -48,7 +48,6 @@ import org.chromium.chrome.browser.prefe
import org.chromium.chrome.browser.preferences.SharedPreferencesManager;
import org.chromium.chrome.browser.privacy.settings.PrivacyPreferencesManager;
import org.chromium.chrome.browser.profiles.Profile;
-import org.chromium.chrome.browser.safe_browsing.SafeBrowsingBridge;
import org.chromium.chrome.browser.settings.ChromeManagedPreferenceDelegate;
import org.chromium.chrome.browser.settings.SettingsActivity;
import org.chromium.chrome.browser.signin.IdentityServicesProvider;
@@ -358,17 +357,9 @@ public class SyncAndServicesSettings ext
PostTask.postTask(UiThreadTaskTraits.DEFAULT, this::updatePreferences);
} else if (PREF_SEARCH_SUGGESTIONS.equals(key)) {
mPrefServiceBridge.setBoolean(Pref.SEARCH_SUGGEST_ENABLED, (boolean) newValue);
- } else if (PREF_SAFE_BROWSING.equals(key)) {
- mPrefServiceBridge.setBoolean(Pref.SAFE_BROWSING_ENABLED, (boolean) newValue);
- // Toggling the safe browsing preference impacts the leak detection and the
- // safe browsing reporting preferences as well.
- PostTask.postTask(UiThreadTaskTraits.DEFAULT,
- this::updateLeakDetectionAndSafeBrowsingReportingPreferences);
} else if (PREF_PASSWORD_LEAK_DETECTION.equals(key)) {
mPrefServiceBridge.setBoolean(
Pref.PASSWORD_MANAGER_LEAK_DETECTION_ENABLED, (boolean) newValue);
- } else if (PREF_SAFE_BROWSING_SCOUT_REPORTING.equals(key)) {
- SafeBrowsingBridge.setSafeBrowsingExtendedReportingEnabled((boolean) newValue);
} else if (PREF_NAVIGATION_ERROR.equals(key)) {
mPrefServiceBridge.setBoolean(Pref.ALTERNATE_ERROR_PAGES_ENABLED, (boolean) newValue);
} else if (PREF_USAGE_AND_CRASH_REPORTING.equals(key)) {
@@ -544,7 +535,6 @@ public class SyncAndServicesSettings ext
mSearchSuggestions.setChecked(mPrefServiceBridge.getBoolean(Pref.SEARCH_SUGGEST_ENABLED));
mNavigationError.setChecked(
mPrefServiceBridge.getBoolean(Pref.ALTERNATE_ERROR_PAGES_ENABLED));
- mSafeBrowsing.setChecked(mPrefServiceBridge.getBoolean(Pref.SAFE_BROWSING_ENABLED));
updateLeakDetectionAndSafeBrowsingReportingPreferences();
@@ -614,10 +604,9 @@ public class SyncAndServicesSettings ext
* its appearance needs to be updated. The same goes for safe browsing reporting.
*/
private void updateLeakDetectionAndSafeBrowsingReportingPreferences() {
- boolean safe_browsing_enabled = mPrefServiceBridge.getBoolean(Pref.SAFE_BROWSING_ENABLED);
+ boolean safe_browsing_enabled = false;
mSafeBrowsingReporting.setEnabled(safe_browsing_enabled);
- mSafeBrowsingReporting.setChecked(safe_browsing_enabled
- && SafeBrowsingBridge.isSafeBrowsingExtendedReportingEnabled());
+ mSafeBrowsingReporting.setChecked(safe_browsing_enabled);
boolean has_token_for_leak_check = PasswordUIView.hasAccountForLeakCheckRequest();
boolean leak_detection_enabled =
@@ -645,10 +634,10 @@ public class SyncAndServicesSettings ext
return mPrefServiceBridge.isManagedPreference(Pref.SEARCH_SUGGEST_ENABLED);
}
if (PREF_SAFE_BROWSING_SCOUT_REPORTING.equals(key)) {
- return SafeBrowsingBridge.isSafeBrowsingExtendedReportingManaged();
+ return false;
}
if (PREF_SAFE_BROWSING.equals(key)) {
- return mPrefServiceBridge.isManagedPreference(Pref.SAFE_BROWSING_ENABLED);
+ return false;
}
if (PREF_PASSWORD_LEAK_DETECTION.equals(key)) {
return mPrefServiceBridge.isManagedPreference(
--- a/weblayer/browser/browser_context_impl.cc
+++ b/weblayer/browser/browser_context_impl.cc
@@ -17,7 +17,6 @@
#include "components/prefs/json_pref_store.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/pref_service_factory.h"
-#include "components/safe_browsing/core/common/safe_browsing_prefs.h"
#include "components/security_interstitials/content/stateful_ssl_host_state_delegate.h"
#include "components/security_state/core/security_state.h"
#include "components/translate/core/browser/translate_pref_names.h"
@@ -236,7 +235,6 @@ void BrowserContextImpl::RegisterPrefs(
StatefulSSLHostStateDelegate::RegisterProfilePrefs(pref_registry);
HostContentSettingsMap::RegisterProfilePrefs(pref_registry);
- safe_browsing::RegisterProfilePrefs(pref_registry);
security_state::RegisterProfilePrefs(pref_registry);
language::LanguagePrefs::RegisterProfilePrefs(pref_registry);
translate::TranslatePrefs::RegisterProfilePrefs(pref_registry);