Compare commits

...
Author SHA1 Message Date
csagan5 79eae0ab09 Release 71.0.3578.120 2019-01-06 13:53:33 +01:00
csagan5 532c9c5c8b Update safe browsing patch for Android to fix issues found by nikolowry 2019-01-04 16:49:17 +01:00
Nikoandcsagan5 f5278822bb Update Remove-Sync-and-Translate-menu.patch to a git binary diff
Restore index meta to updated Remove-Sync-and-Translate-menu.patch
2019-01-04 11:14:33 +01:00
csagan5 a8d215db86 Patches cleanup for safe_browsing 2019-01-02 19:02:12 +01:00
csagan5 2e921bffd8 Mention AdGuard servers 2019-01-02 11:46:49 +01:00
9 changed files with 1449 additions and 277 deletions
+3
View File
@@ -1,3 +1,6 @@
# 71.0.3578.120
* fix breakage of translate quick answers by anti-AMP (fixes https://github.com/bromite/bromite/issues/210)
# 71.0.3578.115
* add AdGuard DNS-over-HTTPS option
* use green icon for SystemWebView
+2 -2
View File
@@ -77,7 +77,7 @@ Yes, since version 69. While the desktop version of Chromium has an option to di
* baked-in adblock engine with filters from EasyList, EasyPrivacy and others
* remove click-tracking and AMP from search results
* DNS-over-HTTPS support via Google, Cloudflare and Quad9 servers
* DNS-over-HTTPS support via Google, Cloudflare, Quad9 and AdGuard servers
* [proxy configuration page](https://github.com/bromite/bromite/wiki/ProxyConfiguration) with PAC and custom proxy lists support
* [StartPage](https://startpage.com/), [DuckDuckGo](https://duckduckgo.com/) and [Qwant](https://www.qwant.com/) search engines
* chrome flags to disable custom intents and clear session on exit
@@ -137,7 +137,7 @@ The [Bromite main repository](https://github.com/bromite/bromite) contains tags
Please refer to [official Chromium build documentation](https://www.chromium.org/developers/how-tos/get-the-code) to get started on how to build Chromium; if you can build Chromium for Android, you can build Bromite.
The GN args used to build Bromite are available here: [GN_ARGS](./GN_ARGS).
The patches are to be applied second the order specified in the `patches_list.txt` file (you can use `git am`); the big file `adblock_entries.h` (containing all the AdBlock filters) needs to be copied under `src/net/url_request/`
The patches are to be applied second the order specified in the `patches_list.txt` file (you can use `git am`); the big file `adblock_entries.h` (containing all the AdBlock filters) needs to be copied under `src/net/url_request/`.
# Credits
+1 -1
View File
@@ -3,7 +3,6 @@ blink_symbol_level=1
dcheck_always_on=false
debuggable_apks=false
enable_ac3_eac3_audio_demuxing=true enable_hevc_demuxing=true enable_iterator_debugging=false
enable_av1_decoder=true
enable_hangout_services_extension=false
enable_mdns=false
enable_mse_mpeg2ts_stream_parser=true ffmpeg_branding="Chrome" proprietary_codecs=true
@@ -25,6 +24,7 @@ symbol_level=1
target_os="android"
use_debug_fission=true
use_errorprone_java_compiler=false
use_jumbo_build=true
use_official_google_api_keys=false
use_openh264=true chrome_pgo_phase=0 full_wpo_on_official=true
use_sysroot=false
File diff suppressed because it is too large Load Diff
@@ -2,14 +2,27 @@ From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Tue, 18 Sep 2018 08:06:14 +0200
Subject: Allow building without safebrowsing for Android
Fix build from scratch (issue found by nikolowry)
---
.../android/java/res/xml/privacy_preferences.xml | 12 -----
.../preferences/privacy/PrivacyPreferences.java | 58 ----------------------
.../chrome_browsing_data_remover_delegate.cc | 10 ----
chrome/browser/chrome_content_browser_client.cc | 14 +-----
.../file_type_policies_component_installer.cc | 2 +
.../download/chrome_download_manager_delegate.cc | 14 +++++-
.../download/chrome_download_manager_delegate.h | 6 +++
chrome/browser/download/download_item_model.cc | 10 ++++
chrome/browser/download/download_item_model.h | 4 ++
chrome/browser/download/download_prefs.cc | 4 ++
.../browser/download/download_target_determiner.cc | 18 +++++++
.../browser/download/download_target_determiner.h | 6 +++
chrome/browser/download/download_target_info.cc | 4 ++
chrome/browser/download/download_target_info.h | 4 ++
chrome/browser/download/download_ui_model.cc | 4 ++
chrome/browser/download/download_ui_model.h | 4 ++
.../chrome_resource_dispatcher_host_delegate.cc | 4 ++
chrome/browser/net/chrome_network_delegate.cc | 35 +------------
6 files changed, 7 insertions(+), 126 deletions(-)
18 files changed, 85 insertions(+), 128 deletions(-)
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
--- a/chrome/android/java/res/xml/privacy_preferences.xml
@@ -180,6 +193,501 @@ diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/ch
}
base::Optional<std::string>
diff --git a/chrome/browser/component_updater/file_type_policies_component_installer.cc b/chrome/browser/component_updater/file_type_policies_component_installer.cc
--- a/chrome/browser/component_updater/file_type_policies_component_installer.cc
+++ b/chrome/browser/component_updater/file_type_policies_component_installer.cc
@@ -18,7 +18,9 @@
#include "base/path_service.h"
#include "base/task/post_task.h"
#include "base/version.h"
+#if defined(FULL_SAFE_BROWSING)
#include "chrome/common/safe_browsing/file_type_policies.h"
+#endif
#include "components/component_updater/component_updater_paths.h"
using component_updater::ComponentUpdateService;
diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc
--- a/chrome/browser/download/chrome_download_manager_delegate.cc
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
@@ -38,8 +38,10 @@
#include "chrome/browser/download/save_package_file_picker.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/profiles/profile.h"
+#if defined(FULL_SAFE_BROWSING)
#include "chrome/browser/safe_browsing/download_protection/download_protection_util.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
+#endif
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/chrome_pages.h"
@@ -49,7 +51,9 @@
#include "chrome/common/chrome_features.h"
#include "chrome/common/pdf_util.h"
#include "chrome/common/pref_names.h"
+#if defined(FULL_SAFE_BROWSING)
#include "chrome/common/safe_browsing/file_type_policies.h"
+#endif
#include "chrome/grit/generated_resources.h"
#include "components/download/database/in_progress/in_progress_cache_impl.h"
#include "components/download/public/common/download_interrupt_reasons.h"
@@ -95,8 +99,10 @@
using content::BrowserThread;
using download::DownloadItem;
using content::DownloadManager;
+#if defined(FULL_SAFE_BROWSING)
using safe_browsing::DownloadFileType;
using safe_browsing::DownloadProtectionService;
+#endif
namespace {
@@ -746,19 +752,19 @@ ChromeDownloadManagerDelegate::ApplicationClientIdForFileScanning() const {
return std::string(chrome::kApplicationClientIDStringForAVScanning);
}
+#if defined(FULL_SAFE_BROWSING)
DownloadProtectionService*
ChromeDownloadManagerDelegate::GetDownloadProtectionService() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
-#if defined(FULL_SAFE_BROWSING)
safe_browsing::SafeBrowsingService* sb_service =
g_browser_process->safe_browsing_service();
if (sb_service && sb_service->download_protection_service() &&
profile_->GetPrefs()->GetBoolean(prefs::kSafeBrowsingEnabled)) {
return sb_service->download_protection_service();
}
-#endif
return NULL;
}
+#endif
void ChromeDownloadManagerDelegate::NotifyExtensions(
DownloadItem* download,
@@ -1201,13 +1207,17 @@ void ChromeDownloadManagerDelegate::OnDownloadTargetDetermined(
DownloadItemModel(item).SetShouldPreferOpeningInBrowser(true);
#endif
+#if defined(FULL_SAFE_BROWSING)
DownloadItemModel(item).SetDangerLevel(target_info->danger_level);
+#endif
}
+#if defined(FULL_SAFE_BROWSING)
if (ShouldBlockFile(target_info->danger_type, item)) {
target_info->result = download::DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED;
// A dangerous type would take precendence over the blocking of the file.
target_info->danger_type = download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS;
}
+#endif
callback.Run(target_info->target_path, target_info->target_disposition,
target_info->danger_type, target_info->intermediate_path,
diff --git a/chrome/browser/download/chrome_download_manager_delegate.h b/chrome/browser/download/chrome_download_manager_delegate.h
--- a/chrome/browser/download/chrome_download_manager_delegate.h
+++ b/chrome/browser/download/chrome_download_manager_delegate.h
@@ -22,8 +22,10 @@
#include "chrome/browser/download/download_path_reservation_tracker.h"
#include "chrome/browser/download/download_target_determiner_delegate.h"
#include "chrome/browser/download/download_target_info.h"
+#if defined(FULL_SAFE_BROWSING)
#include "chrome/browser/safe_browsing/download_protection/download_protection_service.h"
#include "chrome/browser/safe_browsing/download_protection/download_protection_util.h"
+#endif
#include "components/download/public/common/download_danger_type.h"
#include "components/download/public/common/download_item.h"
#include "content/public/browser/download_manager_delegate.h"
@@ -131,8 +133,10 @@ class ChromeDownloadManagerDelegate
DownloadPrefs* download_prefs() { return download_prefs_.get(); }
protected:
+#if defined(FULL_SAFE_BROWSING)
virtual safe_browsing::DownloadProtectionService*
GetDownloadProtectionService();
+#endif
// Show file picker for |download|.
virtual void ShowFilePickerForDownload(
@@ -197,9 +201,11 @@ class ChromeDownloadManagerDelegate
const content::NotificationSource& source,
const content::NotificationDetails& details) override;
+#if defined(FULL_SAFE_BROWSING)
// Callback function after the DownloadProtectionService completes.
void CheckClientDownloadDone(uint32_t download_id,
safe_browsing::DownloadCheckResult result);
+#endif
// Internal gateways for ShouldCompleteDownload().
bool IsDownloadReadyForCompletion(
diff --git a/chrome/browser/download/download_item_model.cc b/chrome/browser/download/download_item_model.cc
--- a/chrome/browser/download/download_item_model.cc
+++ b/chrome/browser/download/download_item_model.cc
@@ -22,9 +22,11 @@
#include "chrome/browser/download/download_stats.h"
#include "chrome/browser/download/offline_item_utils.h"
#include "chrome/browser/profiles/profile.h"
+#if defined(FULL_SAFE_BROWSING)
#include "chrome/browser/safe_browsing/download_protection/download_feedback_service.h"
#include "chrome/common/safe_browsing/download_file_types.pb.h"
#include "chrome/common/safe_browsing/file_type_policies.h"
+#endif
#include "chrome/grit/chromium_strings.h"
#include "chrome/grit/generated_resources.h"
#include "components/download/public/common/download_danger_type.h"
@@ -37,7 +39,9 @@
using base::TimeDelta;
using download::DownloadItem;
+#if defined(FULL_SAFE_BROWSING)
using safe_browsing::DownloadFileType;
+#endif
namespace {
@@ -67,9 +71,11 @@ class DownloadItemModelData : public base::SupportsUserData::Data {
// for the file type.
bool should_prefer_opening_in_browser_;
+#if defined(FULL_SAFE_BROWSING)
// Danger level of the file determined based on the file type and whether
// there was a user action associated with the download.
DownloadFileType::DangerLevel danger_level_;
+#endif
// Whether the download is currently being revived.
bool is_being_revived_;
@@ -106,7 +112,9 @@ DownloadItemModelData::DownloadItemModelData()
: should_show_in_shelf_(true),
was_ui_notified_(false),
should_prefer_opening_in_browser_(false),
+#if defined(FULL_SAFE_BROWSING)
danger_level_(DownloadFileType::NOT_DANGEROUS),
+#endif
is_being_revived_(false) {}
} // namespace
@@ -376,6 +384,7 @@ void DownloadItemModel::SetShouldPreferOpeningInBrowser(bool preference) {
data->should_prefer_opening_in_browser_ = preference;
}
+#if defined(FULL_SAFE_BROWSING)
DownloadFileType::DangerLevel DownloadItemModel::GetDangerLevel() const {
const DownloadItemModelData* data = DownloadItemModelData::Get(download_);
return data ? data->danger_level_ : DownloadFileType::NOT_DANGEROUS;
@@ -386,6 +395,7 @@ void DownloadItemModel::SetDangerLevel(
DownloadItemModelData* data = DownloadItemModelData::GetOrCreate(download_);
data->danger_level_ = danger_level;
}
+#endif
bool DownloadItemModel::IsBeingRevived() const {
const DownloadItemModelData* data = DownloadItemModelData::Get(download_);
diff --git a/chrome/browser/download/download_item_model.h b/chrome/browser/download/download_item_model.h
--- a/chrome/browser/download/download_item_model.h
+++ b/chrome/browser/download/download_item_model.h
@@ -11,7 +11,9 @@
#include "base/macros.h"
#include "base/strings/string16.h"
#include "chrome/browser/download/download_ui_model.h"
+#if defined(FULL_SAFE_BROWSING)
#include "chrome/common/safe_browsing/download_file_types.pb.h"
+#endif
#include "components/download/public/common/download_item.h"
// Implementation of DownloadUIModel that wrappers around a |DownloadItem*|. As
@@ -48,9 +50,11 @@ class DownloadItemModel : public DownloadUIModel,
void SetWasUINotified(bool should_notify) override;
bool ShouldPreferOpeningInBrowser() const override;
void SetShouldPreferOpeningInBrowser(bool preference) override;
+#if defined(FULL_SAFE_BROWSING)
safe_browsing::DownloadFileType::DangerLevel GetDangerLevel() const override;
void SetDangerLevel(
safe_browsing::DownloadFileType::DangerLevel danger_level) override;
+#endif
void OpenUsingPlatformHandler() override;
bool IsBeingRevived() const override;
void SetIsBeingRevived(bool is_being_revived) override;
diff --git a/chrome/browser/download/download_prefs.cc b/chrome/browser/download/download_prefs.cc
--- a/chrome/browser/download/download_prefs.cc
+++ b/chrome/browser/download/download_prefs.cc
@@ -33,7 +33,9 @@
#include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/pref_names.h"
+#if defined(FULL_SAFE_BROWSING)
#include "chrome/common/safe_browsing/file_type_policies.h"
+#endif
#include "components/download/public/common/download_item.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_service.h"
@@ -55,7 +57,9 @@
using content::BrowserContext;
using content::BrowserThread;
using content::DownloadManager;
+#if defined(FULL_SAFE_BROWSING)
using safe_browsing::FileTypePolicies;
+#endif
namespace {
diff --git a/chrome/browser/download/download_target_determiner.cc b/chrome/browser/download/download_target_determiner.cc
--- a/chrome/browser/download/download_target_determiner.cc
+++ b/chrome/browser/download/download_target_determiner.cc
@@ -22,7 +22,9 @@
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
+#if defined(FULL_SAFE_BROWSING)
#include "chrome/common/safe_browsing/file_type_policies.h"
+#endif
#include "chrome/grit/generated_resources.h"
#include "components/download/public/common/download_interrupt_reasons.h"
#include "components/history/core/browser/history_service.h"
@@ -56,13 +58,16 @@
using content::BrowserThread;
using download::DownloadItem;
+#if defined(FULL_SAFE_BROWSING)
using safe_browsing::DownloadFileType;
+#endif
namespace {
const base::FilePath::CharType kCrdownloadSuffix[] =
FILE_PATH_LITERAL(".crdownload");
+#if defined(FULL_SAFE_BROWSING)
// Condenses the results from HistoryService::GetVisibleVisitCountToHost() to a
// single bool. A host is considered visited before if prior visible visits were
// found in history and the first such visit was earlier than the most recent
@@ -76,6 +81,7 @@ void VisitCountsToVisitedBefore(
found_visits && count > 0 &&
(first_visit.LocalMidnight() < base::Time::Now().LocalMidnight()));
}
+#endif
#if defined(OS_WIN)
// Keeps track of whether Adobe Reader is up to date.
@@ -100,7 +106,9 @@ DownloadTargetDeterminer::DownloadTargetDeterminer(
create_target_directory_(false),
conflict_action_(conflict_action),
danger_type_(download->GetDangerType()),
+#if defined(FULL_SAFE_BROWSING)
danger_level_(DownloadFileType::NOT_DANGEROUS),
+#endif
virtual_path_(initial_virtual_path),
is_filetype_handled_safely_(false),
#if defined(OS_ANDROID)
@@ -719,6 +727,7 @@ DownloadTargetDeterminer::Result
return CONTINUE;
}
+#if defined(FULL_SAFE_BROWSING)
// First determine the danger level assuming that the user doesn't have any
// prior visits to the referrer recoreded in history. The resulting danger
// level would be ALLOW_ON_USER_GESTURE if the level depends on the visit
@@ -755,6 +764,7 @@ DownloadTargetDeterminer::Result
// invalid, then assume the referrer has not been visited before.
if (danger_type_ == download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS)
danger_type_ = download::DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE;
+#endif
return CONTINUE;
}
@@ -762,11 +772,13 @@ void DownloadTargetDeterminer::CheckVisitedReferrerBeforeDone(
bool visited_referrer_before) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(STATE_DETERMINE_INTERMEDIATE_PATH, next_state_);
+#if defined(FULL_SAFE_BROWSING)
danger_level_ = GetDangerLevel(
visited_referrer_before ? VISITED_REFERRER : NO_VISITS_TO_REFERRER);
if (danger_level_ != DownloadFileType::NOT_DANGEROUS &&
danger_type_ == download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS)
danger_type_ = download::DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE;
+#endif
DoLoop();
}
@@ -861,7 +873,9 @@ void DownloadTargetDeterminer::ScheduleCallbackAndDeleteSelf(
<< " Intermediate:" << intermediate_path_.AsUTF8Unsafe()
<< " Confirmation reason:" << static_cast<int>(confirmation_reason_)
<< " Danger type:" << danger_type_
+#if defined(FULL_SAFE_BROWSING)
<< " Danger level:" << danger_level_
+#endif
<< " Result:" << static_cast<int>(result);
std::unique_ptr<DownloadTargetInfo> target_info(new DownloadTargetInfo);
@@ -873,7 +887,9 @@ void DownloadTargetDeterminer::ScheduleCallbackAndDeleteSelf(
? DownloadItem::TARGET_DISPOSITION_PROMPT
: DownloadItem::TARGET_DISPOSITION_OVERWRITE);
target_info->danger_type = danger_type_;
+#if defined(FULL_SAFE_BROWSING)
target_info->danger_level = danger_level_;
+#endif
target_info->intermediate_path = intermediate_path_;
target_info->mime_type = mime_type_;
target_info->is_filetype_handled_safely = is_filetype_handled_safely_;
@@ -959,6 +975,7 @@ bool DownloadTargetDeterminer::HasPromptedForPath() const {
DownloadItem::TARGET_DISPOSITION_PROMPT);
}
+#if defined(FULL_SAFE_BROWSING)
DownloadFileType::DangerLevel DownloadTargetDeterminer::GetDangerLevel(
PriorVisitsToReferrer visits) const {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -990,6 +1007,7 @@ DownloadFileType::DangerLevel DownloadTargetDeterminer::GetDangerLevel(
return DownloadFileType::NOT_DANGEROUS;
}
+#endif
void DownloadTargetDeterminer::OnDownloadDestroyed(
DownloadItem* download) {
diff --git a/chrome/browser/download/download_target_determiner.h b/chrome/browser/download/download_target_determiner.h
--- a/chrome/browser/download/download_target_determiner.h
+++ b/chrome/browser/download/download_target_determiner.h
@@ -17,7 +17,9 @@
#include "chrome/browser/download/download_path_reservation_tracker.h"
#include "chrome/browser/download/download_target_determiner_delegate.h"
#include "chrome/browser/download/download_target_info.h"
+#if defined(FULL_SAFE_BROWSING)
#include "chrome/common/safe_browsing/download_file_types.pb.h"
+#endif
#include "components/download/public/common/download_danger_type.h"
#include "components/download/public/common/download_item.h"
#include "content/public/browser/download_manager_delegate.h"
@@ -297,6 +299,7 @@ class DownloadTargetDeterminer : public download::DownloadItem::Observer {
// operation.
bool HasPromptedForPath() const;
+#if defined(FULL_SAFE_BROWSING)
// Returns true if this download should show the "dangerous file" warning.
// Various factors are considered, such as the type of the file, whether a
// user action initiated the download, and whether the user has explicitly
@@ -306,6 +309,7 @@ class DownloadTargetDeterminer : public download::DownloadItem::Observer {
// to true if the download requires explicit user consent.
safe_browsing::DownloadFileType::DangerLevel GetDangerLevel(
PriorVisitsToReferrer visits) const;
+#endif
// download::DownloadItem::Observer
void OnDownloadDestroyed(download::DownloadItem* download) override;
@@ -317,7 +321,9 @@ class DownloadTargetDeterminer : public download::DownloadItem::Observer {
bool create_target_directory_;
DownloadPathReservationTracker::FilenameConflictAction conflict_action_;
download::DownloadDangerType danger_type_;
+#if defined(FULL_SAFE_BROWSING)
safe_browsing::DownloadFileType::DangerLevel danger_level_;
+#endif
base::FilePath virtual_path_;
base::FilePath local_path_;
base::FilePath intermediate_path_;
diff --git a/chrome/browser/download/download_target_info.cc b/chrome/browser/download/download_target_info.cc
--- a/chrome/browser/download/download_target_info.cc
+++ b/chrome/browser/download/download_target_info.cc
@@ -4,12 +4,16 @@
#include "chrome/browser/download/download_target_info.h"
+#if defined(FULL_SAFE_BROWSING)
#include "chrome/common/safe_browsing/file_type_policies.h"
+#endif
DownloadTargetInfo::DownloadTargetInfo()
: target_disposition(download::DownloadItem::TARGET_DISPOSITION_OVERWRITE),
danger_type(download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS),
+#if defined(FULL_SAFE_BROWSING)
danger_level(safe_browsing::DownloadFileType::NOT_DANGEROUS),
+#endif
is_filetype_handled_safely(false),
result(download::DOWNLOAD_INTERRUPT_REASON_NONE) {}
diff --git a/chrome/browser/download/download_target_info.h b/chrome/browser/download/download_target_info.h
--- a/chrome/browser/download/download_target_info.h
+++ b/chrome/browser/download/download_target_info.h
@@ -8,7 +8,9 @@
#include <string>
#include "base/files/file_path.h"
+#if defined(FULL_SAFE_BROWSING)
#include "chrome/common/safe_browsing/download_file_types.pb.h"
+#endif
#include "components/download/public/common/download_danger_type.h"
#include "components/download/public/common/download_interrupt_reasons.h"
#include "components/download/public/common/download_item.h"
@@ -32,6 +34,7 @@ struct DownloadTargetInfo {
// Danger type of the download.
download::DownloadDangerType danger_type;
+#if defined(FULL_SAFE_BROWSING)
// The danger type of the download could be set to MAYBE_DANGEROUS_CONTENT if
// the file type is handled by SafeBrowsing. However, if the SafeBrowsing
// service is unable to verify whether the file is safe or not, we are on our
@@ -57,6 +60,7 @@ struct DownloadTargetInfo {
// SafeBrowsing may flag the file as being malicious, in which case the
// malicious classification should take precedence.
safe_browsing::DownloadFileType::DangerLevel danger_level;
+#endif
// Suggested intermediate path. The downloaded bytes should be written to this
// path until all the bytes are available and the user has accepted a
diff --git a/chrome/browser/download/download_ui_model.cc b/chrome/browser/download/download_ui_model.cc
--- a/chrome/browser/download/download_ui_model.cc
+++ b/chrome/browser/download/download_ui_model.cc
@@ -23,7 +23,9 @@
using base::TimeDelta;
using download::DownloadItem;
+#if defined(FULL_SAFE_BROWSING)
using safe_browsing::DownloadFileType;
+#endif
using offline_items_collection::FailState;
namespace {
@@ -368,12 +370,14 @@ bool DownloadUIModel::ShouldPreferOpeningInBrowser() const {
void DownloadUIModel::SetShouldPreferOpeningInBrowser(bool preference) {}
+#if defined(FULL_SAFE_BROWSING)
DownloadFileType::DangerLevel DownloadUIModel::GetDangerLevel() const {
return DownloadFileType::NOT_DANGEROUS;
}
void DownloadUIModel::SetDangerLevel(
DownloadFileType::DangerLevel danger_level) {}
+#endif
void DownloadUIModel::OpenUsingPlatformHandler() {}
diff --git a/chrome/browser/download/download_ui_model.h b/chrome/browser/download/download_ui_model.h
--- a/chrome/browser/download/download_ui_model.h
+++ b/chrome/browser/download/download_ui_model.h
@@ -14,7 +14,9 @@
#include "base/strings/string16.h"
#include "build/build_config.h"
#include "chrome/browser/profiles/profile_manager.h"
+#if defined(FULL_SAFE_BROWSING)
#include "chrome/common/safe_browsing/download_file_types.pb.h"
+#endif
#include "components/download/public/common/download_item.h"
#include "components/offline_items_collection/core/offline_item.h"
@@ -172,6 +174,7 @@ class DownloadUIModel {
// Change what's returned by ShouldPreferOpeningInBrowser to |preference|.
virtual void SetShouldPreferOpeningInBrowser(bool preference);
+#if defined(FULL_SAFE_BROWSING)
// Return the danger level determined during download target determination.
// The value returned here is independent of the danger level as determined by
// the Safe Browsing.
@@ -180,6 +183,7 @@ class DownloadUIModel {
// Change what's returned by GetDangerLevel().
virtual void SetDangerLevel(
safe_browsing::DownloadFileType::DangerLevel danger_level);
+#endif
// Open the download using the platform handler for the download. The behavior
// of this method will be different from DownloadItem::OpenDownload() if
diff --git a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
--- a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
+++ b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
+8 -27
View File
@@ -18,12 +18,12 @@ New mechanism for adblocking based on Brave's adblocking hook
.../browser/appmenu/AppMenuPropertiesDelegate.java | 38 +++
.../CustomTabAppMenuPropertiesDelegate.java | 2 +
.../java/strings/android_chrome_strings.grd | 11 +
chrome/browser/net/chrome_network_delegate.cc | 83 +++--
chrome/browser/net/chrome_network_delegate.cc | 62 ++++
.../subresource_filter_content_settings_manager.cc | 1 +
net/BUILD.gn | 7 +
net/url_request/adblock_intercept.cc | 341 +++++++++++++++++++++
net/url_request/adblock_intercept.h | 41 +++
12 files changed, 543 insertions(+), 20 deletions(-)
12 files changed, 542 insertions(+)
create mode 100644 net/url_request/adblock_intercept.cc
create mode 100644 net/url_request/adblock_intercept.h
@@ -213,7 +213,7 @@ diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/
#endif
#if defined(OS_CHROMEOS)
@@ -194,34 +196,75 @@ void ChromeNetworkDelegate::set_cookie_settings(
@@ -194,16 +196,76 @@ void ChromeNetworkDelegate::set_cookie_settings(
cookie_settings_ = cookie_settings;
}
@@ -223,26 +223,7 @@ diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/
net::URLRequest* request,
net::CompletionOnceCallback callback,
GURL* new_url) {
- extensions_delegate_->ForwardStartRequestStatus(request);
-
- // The non-redirect case is handled in GoogleURLLoaderThrottle.
- bool force_safe_search =
- (force_google_safe_search_ && force_google_safe_search_->GetValue() &&
- request->is_redirecting());
-
- net::CompletionOnceCallback wrapped_callback = std::move(callback);
-
- if (force_safe_search) {
- wrapped_callback = base::BindOnce(
- &ForceGoogleSafeSearchCallbackWrapper, std::move(wrapped_callback),
- base::Unretained(request), base::Unretained(new_url));
- }
- int rv = extensions_delegate_->NotifyBeforeURLRequest(
- request, std::move(wrapped_callback), new_url);
-
- if (force_safe_search && rv == net::OK && new_url->is_empty())
- safe_search_util::ForceGoogleSafeSearch(request->url(), new_url);
+
+#if defined(OS_ANDROID)
+ if (request) {
+ bool block = false, isValidUrl;
@@ -297,11 +278,11 @@ diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/
+ } // valid URL and info
+ } // request
+#endif // OS_ANDROID
+
extensions_delegate_->ForwardStartRequestStatus(request);
- return rv;
+ extensions_delegate_->ForwardStartRequestStatus(request);
+ return extensions_delegate_->NotifyBeforeURLRequest(
+ request, std::move(callback), new_url);
return extensions_delegate_->NotifyBeforeURLRequest(
request, std::move(callback), new_url);
}
+#undef TRANSPARENT1PXGIF
File diff suppressed because one or more lines are too long
@@ -20,20 +20,111 @@ Subject: Remove Sync and Translate menu
diff --git a/chrome/android/java/res/drawable-hdpi/settings_translate.png b/chrome/android/java/res/drawable-hdpi/settings_translate.png
deleted file mode 100644
index 8067680e81c6ffa1a003c579411173827a3a9f96..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 399
zcmV;A0dW3_P)<h;3K|Lk000e1NJLTq001Na001Ni1ONa4O9@aD00042Nkl<ZcwWuc
zJxjwt0LJme7er{c_yr2Oml}2V3s~G9aP6!}z(tU5et?4AT-<~%x+sFhO}e^tsU(Y=
z0hgddd^pNsLc+Z{l>hP^9KR_C@$!FaVIla45F@WCMg$)o)DW3mQKSdON+{NY%D^rw
zQ6|u}ti|NX7$R7iF@)z*9c+qa0?AUm<7d7%a4MD+^aKw>u^zc5))3o43mLu<Vh_0s
z^onI1i*NbG31VmP*$I~u^o9@~3%Mjy{|2j}Ph4OPO<b`i*Ms^ERzc?^JnUm8&>5G;
z8!SRo0o`C5w_HXQp+hq2?!?{u8c0%8C3Jue>()aulqxVESiz93aydblXyA)AxSXIZ
z^u+3MIY49igeSZ=wug@XJ`tWQp%m)~(480Xl-fZ9?!ILEyg9Ig+E_v&p@gTlA*4tf
tij`2N2SrL~qywpbE;5V|EcpMCd%u4DGPZTzo=E@z002ovPDHLkV1m$asKNjM
diff --git a/chrome/android/java/res/drawable-mdpi/settings_translate.png b/chrome/android/java/res/drawable-mdpi/settings_translate.png
deleted file mode 100644
index 3b9b4cd482d36a60d4ff0a110b0bcefabe4c1060..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 284
zcmV+%0ptFOP)<h;3K|Lk000e1NJLTq000;O000;W1ONa4N`Cco0002vNkl<ZcwV*C
zy$-=p90hPI21^H{kVr7~0h$;*gq(zkcms==tbG8pC$M2)sTe$f#Kz1feE^(W(wipt
z>YqeTIHw=KscAEhFY_CKhZ7#j@Qh~#`t~HT1AWt&iOFYBic(;rl@5Y9UG&&#fH`9r
zbqhPT0Nhc-8hg~aB!JnVj0zT9La;<0Ijq#SJr@m*036I22Uj!E;6TtuAD4*o-y97Z
ziWuYbs-FagXn-mvsLH_>O?Hzl1RVtIfGq+yWZ%bGZULC0h?xp|DgiD=uf=xl!2Uvo
icHkLEh=B&e`~;qlBW{m=6s{@&0000<MNUMnLSTX)y>C|l
diff --git a/chrome/android/java/res/drawable-xhdpi/settings_translate.png b/chrome/android/java/res/drawable-xhdpi/settings_translate.png
deleted file mode 100644
index 131a57394ca30dcff4bebcb2471bbbf0e1ac134e..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 547
zcmV+;0^I$HP)<h;3K|Lk000e1NJLTq001xm001xu1ONa4{R=S+0005%Nkl<ZcwX(-
zziU%b9ER~X&>vK2=pT?4!CJ8B5V|`lSO?MdsRak2|3E2<Ew~ov3nC6K4yBGdHyIT=
z*iKQTa&gEaRP2_R<9E1(_FiJ{F<-%<Je=X3K5*}FI12x`^1wNOsFIKphLn;}MY&1<
zRa%6SwW!7e2_d2+9!QG-C&)S}0;KUkhyudj0~b#<hpahU{YD2gq>+I}uBO%C0%8~2
zqX2{ZjJTXFC*U;?c-ddi5s!R<4~S{LXX_djTCRX~3-JV7yh7Y2cms!wTkrY83}bwB
z2dpi`B^D8n3HSqaSVYzpI`{+pWDRAl*>VMX>`+5Y@YI?>wsz=YK)L(kPe6xV>d0E+
zF#Fw0h$>%W?u)^|9b`@O%&0zU>qXpsF&Oy9RW@l8a&@DCv<Q46cvb|~;{k3U>t;Ei
z!kb9ohzhbQ9F+l#U_I(XZ6fPFVyg@=tm03vA!hhtr^YXT;4QKq66}a~{=i*iH3)XZ
zJ#V1R7-E(l!Okq>w0(hXWNl<?1F`K3EFkM3TL*{*PoRnN1<~{aRuPk2Kh<Oqt6sn{
zQ;3x_<Vp}z9QyzXvi8mZd)X7f1*jwDbN5@1`5@{JK-uDfGz#d(14$IH9}C1i5_>Gi
l0_C5%UG`c2pI-Xsz;EN&!BMZ3jZy#r002ovPDHLkV1l>+@2da+
diff --git a/chrome/android/java/res/drawable-xxhdpi/settings_translate.png b/chrome/android/java/res/drawable-xxhdpi/settings_translate.png
deleted file mode 100644
index 55878e697b1afed1b4f039a561dc6212e24fc024..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 793
zcmV+!1LpjRP)<h;3K|Lk000e1NJLTq002k;002k`1ONa4|Kxkj0008uNkl<ZcwX(=
z%}Z2a6vy!qU&7QD6$CjgbzuaFrMYX-gy1F-TYN#>*(&T0P^f5;ixxw==!FDzQOmLj
zW)TU|$~Iz9Aez>~5MeSGNzOdU;V@i=JI&0U$NLB~{9rb}%fp9z&%hk!M$92gIe;pl
z3Wyj9l9(csBteWw5h(;j9dXi_fJqal&Mqj9DKT-2AY!CT2BnGF10^sPlCTEKJIX71
z)JmT5wgxg*K&DJUmwnQupf11mfI$K*D&+>^c2@3W<t}H1aS^@Zph5Z5CZJigaScjR
zMTBa$!Uuig{eHe=HE-q67$$tsm>kf|A8$jyfS$PkZE!?L6P{+3Y9btC#|6l6Q$SJA
zJsJ|?2*wTQCyfHQr_G#j>iOXcWOyKi8a`n7&M5)i$G8LSaX}DgSmV5K&hghJ$naGk
zn|yMVCHFr+W;};YV_bu_81R4w*m4VcMRV41&CGcb!S=Xdpk;b9jBZ}iok8`oEP#^s
zxZ*(HxIwJ~nwTJkA;knuN_trO9#=T%BSV6b(8Ic?TcZbSdt70l>n4JR)6DpO>*nq3
zafN}FIj#?Cl$~5NU<H)S4chdQct;y?eqjzexj|EYm%9W-*|Z3FLPYa42uQ+JQr19S
z8PKI*ASGG4OG`vN`5X|W4{pi=YD6F%bO`8HV30TDOK#3CCj|0{M*=#@u3OM^=^OdI
zpGG0Qa0|L3{jfB{0*bi=tx_fZf;0;Ps$$h0XjBJU8y)O1SD-zjI?&qaU`I*00lm%)
zv^JT+e&Yso%`?y%9qc|Apbcs~1Fg})u4N;9(71N~84n-S`d?6M*r0iB`k2m2pEmR1
zf(Er&%x+lJW-v@pl6q-6F+S;(uAXFgph;~W`+^>8I~g9RU77~AeL>qaNZ%d;C_u^s
zlss&pgcZ=5Jy6WbGCgY#WaDr39a`*x^u>dcIQ=590n!A0HN&vZEG?C{V=ABuDD3<L
X<=DewY$H`b00000NkvXXu0mjfrJ!K8
diff --git a/chrome/android/java/res/drawable-xxxhdpi/settings_translate.png b/chrome/android/java/res/drawable-xxxhdpi/settings_translate.png
deleted file mode 100644
index 058b50b84dd216d983e9dea2ea264b39773ac318..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 1038
zcmV+p1o8WcP)<h;3K|Lk000e1NJLTq003YB003YJ1ONa4NRhv@000BkNkl<ZcwX(>
zK}Zx)90u@NR77ZDqzI8+I%LtIBq1>CB9(`rB#V~#N{sTXQQ#UFR4mj+L_yL)FVdw5
zWziyt2t7o(5K@$fpoFMU*4D8)xU9Pq43Ec~9k(6b`LAza_%8CfJov%x+j;ZfQFNEb
z12`KG-~l{<2LKCHgb{}Zy~t>YBMcRaBe4w#ApzaNBoHbkpa(iZdP)TdK_^P66aW<o
zGC%?<Js=F7FkyN?+%{m2FFR)&5T^%dqyUW`ppydhRRcUgbKdOZfPML2wf+F5xOe~$
za5X2_a&lcrfC1Ws*OwkpL^d<PXBoFq``hX^=<WnOVSo$r0_HGoWCB?$0G$l*T3*0U
zRIr6&7Qk=#4L}fCncqTZ7+{YDaF5Y0%Y7~MjxY7x)Mrs=v_5>56u{HU0Q*gCKWkg%
zzZ!iHpXGBfgAJ^klo-HsmH{^5htXtkfHkMxaUPh*CPp}jjBvX|#jNB2o*};A4dL$x
zZaR^jWPl1(GQd%H9Vr*E#k6n`zua~vj+y|s+;yl=;Uat{fDf0DatmMzyH{Mi0aNk=
z7SV+=VZjqPArQ*Yg+(*KsriBvfHVeB1BIss!$v=x(+(m{a9cQ39AFtk*a}5R2a=qY
zM2G2rH)-YzYX!{XHtL`Vsl}LuIEGp%Af7L*1<;Mkoc-n;k}EEs#5wq==L@R`yh6DE
zXe@BOIf?tU^9B0=>sf0D9wH09K(eHO_}X@%^EiwcGSJsOT46u}y38pI7<D_Kr9^-i
zP=vg64xr$P1wcPDKIJ5!8q?%}`J8W;O8jyTpdd(2xC138cbx<%s3v|R?c{)Z)Ej_Z
zjsbXDFiNzkzJbCM<!8IM&H##xEx>u<B=-&9*y*m*Er37RzyZxh(`*3z`0Eb9fWRFv
zHG}Q|Gzy#Ng3&CnO?9su03QYHao!$h%_sQ*-2z~Qw<D~%AUhz1jU1q2iT6uT*&Xkc
z+<->{wR6Q0;bXZ0hXla52{6vu7MTGve7a+uW@Zs&Q??m-0eu3rC-3h{ugD5mMnC|3
zumC<VKmZvz0Z(nO@k~y@G24JP83D5>w+*PktbBkdCkD`$Cjm}~$_Loa0g=4O2nTGJ
z4KN`LLB8h&d>4i%6LJCCIpB!UT62U0+GPT0sN#Uwe*rNLsDdUBpr7+<3XGr9!nmqm
z9zX*J^g=I?UJhtjCjd!2fc<E02gFGMDSAMd6fjK>P)UbW5mEs8p!*B_)Bwsy8PjNj
zLJc5zn3UxUnxN1F9DJOYCxvN5;D?e6@Sf=Q03N^tcmNOZ5BbKcjE%x^TL1t607*qo
IM6N<$g2Gw1A^-pY
diff --git a/chrome/android/java/res/xml/site_settings_preferences.xml b/chrome/android/java/res/xml/site_settings_preferences.xml
index d5ae426f7d7b..a01b1144639c 100644
--- a/chrome/android/java/res/xml/site_settings_preferences.xml
+++ b/chrome/android/java/res/xml/site_settings_preferences.xml
@@ -50,9 +50,9 @@
@@ -63,7 +154,6 @@ index d5ae426f7d7b..a01b1144639c 100644
<!-- TODO(finnur): Move this over to the new Usage screen, once it exists. -->
<org.chromium.chrome.browser.preferences.website.SiteSettingsPreference
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferences.java
index 95a1c127a28f..e8b87fcefb3f 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferences.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferences.java
@@ -39,7 +39,6 @@ public class SiteSettingsPreferences extends PreferenceFragment
@@ -0,0 +1,109 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 20 Dec 2018 18:23:32 +0100
Subject: Revert "Download location android: Check SD card before showing
location dialog."
This reverts commit 9ade596cc0b315f1f9c3292e1fd8d6182e32fde2.
---
.../download/DownloadLocationDialogBridge.java | 50 +++-------------------
1 file changed, 6 insertions(+), 44 deletions(-)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadLocationDialogBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadLocationDialogBridge.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadLocationDialogBridge.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadLocationDialogBridge.java
@@ -4,9 +4,6 @@
package org.chromium.chrome.browser.download;
-import android.content.Context;
-import android.text.TextUtils;
-
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.chrome.browser.ChromeActivity;
@@ -17,7 +14,6 @@ import org.chromium.chrome.browser.preferences.PrefServiceBridge;
import org.chromium.ui.base.WindowAndroid;
import java.io.File;
-import java.util.ArrayList;
/**
* Helper class to handle communication between download location dialog and native.
@@ -26,10 +22,6 @@ public class DownloadLocationDialogBridge implements ModalDialogView.Controller
private long mNativeDownloadLocationDialogBridge;
private DownloadLocationDialog mLocationDialog;
private ModalDialogManager mModalDialogManager;
- private long mTotalBytes;
- private @DownloadLocationDialogType int mDialogType;
- private String mSuggestedPath;
- private Context mContext;
private DownloadLocationDialogBridge(long nativeDownloadLocationDialogBridge) {
mNativeDownloadLocationDialogBridge = nativeDownloadLocationDialogBridge;
@@ -60,13 +52,12 @@ public class DownloadLocationDialogBridge implements ModalDialogView.Controller
}
mModalDialogManager = activity.getModalDialogManager();
- mContext = activity;
- mTotalBytes = totalBytes;
- mDialogType = dialogType;
- mSuggestedPath = suggestedPath;
- DownloadDirectoryProvider.getInstance().getAllDirectoriesOptions(
- (ArrayList<DirectoryOption> dirs) -> { onDirectoryOptionsRetrieved(dirs); });
+ if (mLocationDialog != null) return;
+ mLocationDialog = DownloadLocationDialog.create(
+ this, activity, totalBytes, dialogType, new File(suggestedPath));
+
+ mModalDialogManager.showDialog(mLocationDialog, ModalDialogManager.ModalDialogType.APP);
}
@Override
@@ -101,34 +92,6 @@ public class DownloadLocationDialogBridge implements ModalDialogView.Controller
}
/**
- * Called after retrieved the download directory options.
- * @param dirs An list of available download directories.
- */
- private void onDirectoryOptionsRetrieved(ArrayList<DirectoryOption> dirs) {
- // If there is only one directory available, don't show the default dialog, and set the
- // download directory to default. Dialog will still show for other types of dialogs, like
- // name conflict or disk error.
- if (dirs.size() == 1 && mDialogType == DownloadLocationDialogType.DEFAULT) {
- final DirectoryOption dir = dirs.get(0);
- if (dir.type == DirectoryOption.DownloadLocationDirectoryType.DEFAULT) {
- assert(!TextUtils.isEmpty(dir.location));
- PrefServiceBridge.getInstance().setDownloadAndSaveFileDefaultDirectory(
- dir.location);
- nativeOnComplete(mNativeDownloadLocationDialogBridge, mSuggestedPath);
- }
- return;
- }
-
- // Already showing the dialog.
- if (mLocationDialog != null) return;
-
- // Actually show the dialog.
- mLocationDialog = DownloadLocationDialog.create(
- this, mContext, mTotalBytes, mDialogType, new File(mSuggestedPath));
- mModalDialogManager.showDialog(mLocationDialog, ModalDialogManager.ModalDialogType.APP);
- }
-
- /**
* Pass along information from location dialog to native.
*
* @param fileName Name the user gave the file.
@@ -156,8 +119,7 @@ public class DownloadLocationDialogBridge implements ModalDialogView.Controller
nativeOnComplete(mNativeDownloadLocationDialogBridge, file.getAbsolutePath());
}
- // Update preference to show prompt based on whether checkbox is checked only when the user
- // click the positive button.
+ // Update preference to show prompt based on whether checkbox is checked.
if (dontShowAgain) {
PrefServiceBridge.getInstance().setPromptForDownloadAndroid(
DownloadPromptStatus.DONT_SHOW);
--
2.11.0