diff --git a/developer_utilities/quilt_patches.py b/developer_utilities/quilt_patches.py index 0e2c6b65..76c9d3fa 100755 --- a/developer_utilities/quilt_patches.py +++ b/developer_utilities/quilt_patches.py @@ -58,11 +58,11 @@ def main(action, patch_name=None): if action == "recreate": if (builder.build_dir / buildlib._PATCHES).exists(): - builder.logger.warning("Sandbox patches directory already exists. Trying to unapply...") - result = _run_quilt("pop", "-a") - print(result) - if not result.returncode == 0 and not result.returncode == 2: - return 1 + #builder.logger.warning("Sandbox patches directory already exists. Trying to unapply...") + #result = _run_quilt("pop", "-a") + #print(result) + #if not result.returncode == 0 and not result.returncode == 2: + # return 1 shutil.rmtree(str(builder.build_dir / buildlib._PATCHES)) builder.apply_patches() return 0 diff --git a/resources/common/patches/iridium-browser/net-add-trk-scheme-and-help-identify-URLs-being-retr.patch b/resources/common/patches/iridium-browser/net-add-trk-scheme-and-help-identify-URLs-being-retr.patch index b2a56d70..544a3340 100644 --- a/resources/common/patches/iridium-browser/net-add-trk-scheme-and-help-identify-URLs-being-retr.patch +++ b/resources/common/patches/iridium-browser/net-add-trk-scheme-and-help-identify-URLs-being-retr.patch @@ -336,7 +336,7 @@ index 0000000..4935263 +void TrkBar::Create(InfoBarService *s, const GURL &url) +{ + s->AddInfoBar(s->CreateConfirmInfoBar( -+ scoped_ptr(new TrkBar(url)) ++ std::unique_ptr(new TrkBar(url)) + )); +} + diff --git a/resources/common/patches/ungoogled-chromium/clear-http-auth-cache-menu-item.patch b/resources/common/patches/ungoogled-chromium/clear-http-auth-cache-menu-item.patch index 8719e276..f37a57e3 100644 --- a/resources/common/patches/ungoogled-chromium/clear-http-auth-cache-menu-item.patch +++ b/resources/common/patches/ungoogled-chromium/clear-http-auth-cache-menu-item.patch @@ -93,7 +93,7 @@ ShowClearBrowsingDataDialog(browser_); break; + case IDC_CLEAR_HTTP_AUTH_CACHE: -+ browser_->tab_strip_model()->GetActiveWebContents()->GetBrowserContext()->GetRequestContext()->GetURLRequestContext()->http_transaction_factory()->GetSession()->http_auth_cache()->Clear(); ++ profile()->GetRequestContext()->GetURLRequestContext()->http_transaction_factory()->GetSession()->http_auth_cache()->Clear(); + break; case IDC_IMPORT_SETTINGS: ShowImportDialog(browser_); diff --git a/resources/common/patches/ungoogled-chromium/disable-translate.patch b/resources/common/patches/ungoogled-chromium/disable-translate.patch index c9c29945..c1282074 100644 --- a/resources/common/patches/ungoogled-chromium/disable-translate.patch +++ b/resources/common/patches/ungoogled-chromium/disable-translate.patch @@ -12,34 +12,105 @@ if (!language_state_.page_needs_translation() || --- a/components/translate/content/renderer/translate_helper.cc +++ b/components/translate/content/renderer/translate_helper.cc -@@ -83,6 +83,7 @@ scoped_ptr CreateDataProvider( +@@ -67,38 +67,6 @@ const char kContentSecurityPolicy[] = "script-src 'self' 'unsafe-eval'"; // should not be translated. // TODO(dglazkov): This logic should be moved into Blink. bool HasNoTranslateMeta(WebDocument* document) { -+ return false; - WebElement head = document->head(); - if (head.isNull() || !head.hasChildNodes()) - return false; -@@ -140,7 +140,10 @@ TranslateHelper::TranslateHelper(content::RenderFrame* render_frame, +- WebElement head = document->head(); +- if (head.isNull() || !head.hasChildNodes()) +- return false; +- +- const WebString meta(ASCIIToUTF16("meta")); +- const WebString name(ASCIIToUTF16("name")); +- const WebString google(ASCIIToUTF16("google")); +- const WebString value(ASCIIToUTF16("value")); +- const WebString content(ASCIIToUTF16("content")); +- +- for (WebNode child = head.firstChild(); !child.isNull(); +- child = child.nextSibling()) { +- if (!child.isElementNode()) +- continue; +- WebElement element = child.to(); +- // Check if a tag is . +- if (!element.hasHTMLTagName(meta)) +- continue; +- // Check if the tag contains name="google". +- WebString attribute = element.getAttribute(name); +- if (attribute.isNull() || attribute != google) +- continue; +- // Check if the tag contains value="notranslate", or content="notranslate". +- attribute = element.getAttribute(value); +- if (attribute.isNull()) +- attribute = element.getAttribute(content); +- if (attribute.isNull()) +- continue; +- if (base::LowerCaseEqualsASCII(base::StringPiece16(attribute), +- "notranslate")) +- return true; +- } + return false; + } + +@@ -119,7 +87,9 @@ TranslateHelper::TranslateHelper(content::RenderFrame* render_frame, world_id_(world_id), extension_group_(extension_group), extension_scheme_(extension_scheme), - weak_method_factory_(this) {} + weak_method_factory_(this) { + CancelPendingTranslation(); -+ CancelCldDataPolling(); +} - + TranslateHelper::~TranslateHelper() { - CancelPendingTranslation(); -@@ -391,6 +394,7 @@ void TranslateHelper::OnTranslatePage(int page_seq_no, + } +@@ -321,48 +291,6 @@ void TranslateHelper::OnTranslatePage(int page_seq_no, const std::string& translate_script, const std::string& source_lang, const std::string& target_lang) { -+ return; - WebLocalFrame* main_frame = render_frame()->GetWebFrame(); - if (!main_frame || page_seq_no_ != page_seq_no) - return; // We navigated away, nothing to do. +- WebLocalFrame* main_frame = render_frame()->GetWebFrame(); +- if (!main_frame || page_seq_no_ != page_seq_no) +- return; // We navigated away, nothing to do. +- +- // A similar translation is already under way, nothing to do. +- if (translation_pending_ && target_lang_ == target_lang) +- return; +- +- // Any pending translation is now irrelevant. +- CancelPendingTranslation(); +- +- // Set our states. +- translation_pending_ = true; +- +- // If the source language is undetermined, we'll let the translate element +- // detect it. +- source_lang_ = (source_lang != kUnknownLanguageCode) ? source_lang +- : kAutoDetectionLanguage; +- target_lang_ = target_lang; +- +- ReportUserActionDuration(language_determined_time_, base::TimeTicks::Now()); +- +- GURL url(main_frame->document().url()); +- ReportPageScheme(url.scheme()); +- +- // Set up v8 isolated world with proper content-security-policy and +- // security-origin. +- main_frame->setIsolatedWorldContentSecurityPolicy( +- world_id_, WebString::fromUTF8(kContentSecurityPolicy)); +- +- GURL security_origin = GetTranslateSecurityOrigin(); +- main_frame->setIsolatedWorldSecurityOrigin( +- world_id_, WebSecurityOrigin::create(security_origin)); +- +- if (!IsTranslateLibAvailable()) { +- // Evaluate the script to add the translation related method to the global +- // context of the page. +- ExecuteScript(translate_script); +- DCHECK(IsTranslateLibAvailable()); +- } +- +- TranslatePageImpl(page_seq_no, 0); + } + + void TranslateHelper::OnRevertTranslation(int page_seq_no) { --- a/components/translate/core/browser/translate_script.cc +++ b/components/translate/core/browser/translate_script.cc @@ -132,9 +132,8 @@ void TranslateScript::OnScriptFetchComplete( diff --git a/resources/common/patches/ungoogled-chromium/enable-page-saving-on-more-pages.patch b/resources/common/patches/ungoogled-chromium/enable-page-saving-on-more-pages.patch index bcb51203..095f4c44 100644 --- a/resources/common/patches/ungoogled-chromium/enable-page-saving-on-more-pages.patch +++ b/resources/common/patches/ungoogled-chromium/enable-page-saving-on-more-pages.patch @@ -13,7 +13,7 @@ url::kHttpScheme, url::kHttpsScheme, url::kFileScheme, -@@ -21,6 +25,17 @@ const char* const kDefaultSavableSchemes[] = { +@@ -21,6 +25,15 @@ const char* const kDefaultSavableSchemes[] = { kChromeDevToolsScheme, kChromeUIScheme, url::kDataScheme, @@ -22,8 +22,6 @@ + url::kWsScheme, + url::kWssScheme, + kGuestScheme, -+ kMetadataScheme, -+ kSwappedOutScheme, + kViewSourceScheme, +#if defined(OS_CHROMEOS) + kExternalFileScheme, @@ -73,12 +71,12 @@ void ShowFindBar(Browser* browser) { --- a/components/offline_pages/offline_page_model.cc +++ b/components/offline_pages/offline_page_model.cc -@@ -110,7 +110,7 @@ void EnsureArchivesDirCreated(const base::FilePath& archives_dir) { +@@ -10,7 +10,7 @@ namespace offline_pages { // static - bool OfflinePageModel::CanSavePage(const GURL& url) { -- return url.SchemeIsHTTPOrHTTPS(); -+ return true; + bool OfflinePageModel::CanSaveURL(const GURL& url) { +- return url.is_valid() && url.SchemeIsHTTPOrHTTPS(); ++ return url.is_valid(); } - // static + OfflinePageModel::OfflinePageModel() {} diff --git a/resources/common/patches/ungoogled-chromium/fix-building-without-one-click-signin.patch b/resources/common/patches/ungoogled-chromium/fix-building-without-one-click-signin.patch index 31981838..f1e7caa5 100644 --- a/resources/common/patches/ungoogled-chromium/fix-building-without-one-click-signin.patch +++ b/resources/common/patches/ungoogled-chromium/fix-building-without-one-click-signin.patch @@ -2,7 +2,7 @@ --- a/chrome/chrome_browser_ui.gypi +++ b/chrome/chrome_browser_ui.gypi -@@ -3347,6 +3347,18 @@ +@@ -3342,6 +3342,20 @@ ], 'sources': [ '<@(chrome_browser_ui_media_router_sources)' ], }], @@ -10,6 +10,8 @@ + 'sources!': [ + 'browser/ui/views/sync/one_click_signin_bubble_view.cc', + 'browser/ui/views/sync/one_click_signin_bubble_view.h', ++ 'browser/ui/views/sync/one_click_signin_dialog_view.cc', ++ 'browser/ui/views/sync/one_click_signin_dialog_view.h', + 'browser/ui/cocoa/one_click_signin_bubble_controller.h', + 'browser/ui/cocoa/one_click_signin_bubble_controller.mm', + 'browser/ui/cocoa/one_click_signin_dialog_controller.h', @@ -39,22 +41,21 @@ } void OneClickSigninSyncStarter::UntrustedSigninConfirmed( ---- a/chrome/browser/ui/sync/one_click_signin_bubble_links_delegate.cc -+++ b/chrome/browser/ui/sync/one_click_signin_bubble_links_delegate.cc -@@ -17,13 +17,17 @@ OneClickSigninBubbleLinksDelegate::~OneClickSigninBubbleLinksDelegate() {} +--- a/chrome/browser/ui/sync/one_click_signin_links_delegate_impl.cc ++++ b/chrome/browser/ui/sync/one_click_signin_links_delegate_impl.cc +@@ -17,12 +17,16 @@ OneClickSigninLinksDelegateImpl::OneClickSigninLinksDelegateImpl( + OneClickSigninLinksDelegateImpl::~OneClickSigninLinksDelegateImpl() {} - void OneClickSigninBubbleLinksDelegate::OnLearnMoreLinkClicked( - bool is_dialog) { + void OneClickSigninLinksDelegateImpl::OnLearnMoreLinkClicked(bool is_dialog) { +#if BUILDFLAG(ENABLE_ONE_CLICK_SIGNIN) - chrome::NavigateParams params(browser_, - GURL(chrome::kChromeSyncLearnMoreURL), + chrome::NavigateParams params(browser_, GURL(chrome::kChromeSyncLearnMoreURL), ui::PAGE_TRANSITION_LINK); params.disposition = is_dialog ? NEW_WINDOW : NEW_FOREGROUND_TAB; chrome::Navigate(¶ms); +#endif } - void OneClickSigninBubbleLinksDelegate::OnAdvancedLinkClicked() { + void OneClickSigninLinksDelegateImpl::OnAdvancedLinkClicked() { +#if BUILDFLAG(ENABLE_ONE_CLICK_SIGNIN) chrome::ShowSettingsSubPage(browser_, chrome::kSyncSetupSubPage); +#endif diff --git a/resources/common/patches/ungoogled-chromium/fix-building-without-safebrowsing.patch b/resources/common/patches/ungoogled-chromium/fix-building-without-safebrowsing.patch index 6e39f29b..d09b9ca7 100644 --- a/resources/common/patches/ungoogled-chromium/fix-building-without-safebrowsing.patch +++ b/resources/common/patches/ungoogled-chromium/fix-building-without-safebrowsing.patch @@ -2,7 +2,7 @@ --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc -@@ -592,10 +592,10 @@ class SafeBrowsingSSLCertReporter : public SSLCertReporter { +@@ -621,10 +621,6 @@ class SafeBrowsingSSLCertReporter : public SSLCertReporter { // SSLCertReporter implementation void ReportInvalidCertificateChain( const std::string& serialized_report) override { @@ -10,31 +10,25 @@ - safe_browsing_ui_manager_->ReportInvalidCertificateChain( - serialized_report, base::Bind(&base::DoNothing)); - } -+ //if (safe_browsing_ui_manager_) { -+ // safe_browsing_ui_manager_->ReportInvalidCertificateChain( -+ // serialized_report, base::Bind(&base::DoNothing)); -+ //} } private: -@@ -1504,7 +1504,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( +@@ -1535,7 +1531,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( // Disable client-side phishing detection in the renderer if it is // disabled in the Profile preferences or the browser process. if (!prefs->GetBoolean(prefs::kSafeBrowsingEnabled) || - !g_browser_process->safe_browsing_detection_service()) { -+ !false) { ++ true) { command_line->AppendSwitch( switches::kDisableClientSidePhishingDetection); } -@@ -2037,11 +2037,11 @@ void ChromeContentBrowserClient::AllowCertificateError( +@@ -2077,11 +2073,9 @@ void ChromeContentBrowserClient::AllowCertificateError( if (expired_previous_decision) options_mask |= SSLErrorUI::EXPIRED_BUT_PREVIOUSLY_ALLOWED; - safe_browsing::SafeBrowsingService* safe_browsing_service = - g_browser_process->safe_browsing_service(); -+ //safe_browsing::SafeBrowsingService* safe_browsing_service = -+ // g_browser_process->safe_browsing_service(); - scoped_ptr cert_reporter( + std::unique_ptr cert_reporter( - new SafeBrowsingSSLCertReporter(safe_browsing_service - ? safe_browsing_service->ui_manager() + new SafeBrowsingSSLCertReporter(false @@ -226,7 +220,7 @@ --- a/chrome/browser/browsing_data/browsing_data_remover.cc +++ b/chrome/browser/browsing_data/browsing_data_remover.cc -@@ -612,27 +612,6 @@ void BrowsingDataRemover::RemoveImpl(const TimeRange& time_range, +@@ -642,38 +642,6 @@ void BrowsingDataRemover::RemoveImpl( storage_partition_remove_mask |= content::StoragePartition::REMOVE_DATA_MASK_COOKIES; @@ -241,13 +235,24 @@ - scoped_refptr sb_context = - sb_service->url_request_context(); - ++waiting_for_clear_cookies_count_; -- BrowserThread::PostTask( -- BrowserThread::IO, FROM_HERE, -- base::Bind(&ClearCookiesOnIOThread, delete_begin_, delete_end_, -- base::RetainedRef(std::move(sb_context)), -- UIThreadTrampoline( -- base::Bind(&BrowsingDataRemover::OnClearedCookies, -- weak_ptr_factory_.GetWeakPtr())))); +- if (filter_builder.IsEmptyBlacklist()) { +- BrowserThread::PostTask( +- BrowserThread::IO, FROM_HERE, +- base::Bind(&ClearCookiesOnIOThread, delete_begin_, delete_end_, +- base::RetainedRef(std::move(sb_context)), +- UIThreadTrampoline( +- base::Bind(&BrowsingDataRemover::OnClearedCookies, +- weak_ptr_factory_.GetWeakPtr())))); +- } else { +- BrowserThread::PostTask( +- BrowserThread::IO, FROM_HERE, +- base::Bind(&ClearCookiesWithPredicateOnIOThread, delete_begin_, +- delete_end_, filter_builder.BuildCookieFilter(), +- base::RetainedRef(std::move(sb_context)), +- UIThreadTrampoline( +- base::Bind(&BrowsingDataRemover::OnClearedCookies, +- weak_ptr_factory_.GetWeakPtr())))); +- } - } - } - @@ -256,28 +261,40 @@ --- a/chrome/browser/download/chrome_download_manager_delegate.cc +++ b/chrome/browser/download/chrome_download_manager_delegate.cc -@@ -194,12 +194,12 @@ ChromeDownloadManagerDelegate::~ChromeDownloadManagerDelegate() { +@@ -208,13 +208,6 @@ ChromeDownloadManagerDelegate::~ChromeDownloadManagerDelegate() { + void ChromeDownloadManagerDelegate::SetDownloadManager(DownloadManager* dm) { download_manager_ = dm; - +- - safe_browsing::SafeBrowsingService* sb_service = - g_browser_process->safe_browsing_service(); - if (sb_service && !profile_->IsOffTheRecord()) { - // Include this download manager in the set monitored by safe browsing. - sb_service->AddDownloadManager(dm); - } -+ //safe_browsing::SafeBrowsingService* sb_service = -+ // g_browser_process->safe_browsing_service(); -+ //if (sb_service && !profile_->IsOffTheRecord()) { -+ // // Include this download manager in the set monitored by safe browsing. -+ // sb_service->AddDownloadManager(dm); -+ //} } void ChromeDownloadManagerDelegate::Shutdown() { +@@ -450,16 +443,6 @@ void ChromeDownloadManagerDelegate::ChooseSavePath( + + void ChromeDownloadManagerDelegate::SanitizeSavePackageResourceName( + base::FilePath* filename) { +- safe_browsing::FileTypePolicies* file_type_policies = +- safe_browsing::FileTypePolicies::GetInstance(); +- +- if (file_type_policies->GetFileDangerLevel(*filename) == +- safe_browsing::DownloadFileType::NOT_DANGEROUS) +- return; +- +- base::FilePath default_filename = base::FilePath::FromUTF8Unsafe( +- l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME)); +- *filename = filename->AddExtension(default_filename.BaseName().value()); + } + + void ChromeDownloadManagerDelegate::OpenDownloadUsingPlatformHandler( --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc -@@ -62,7 +62,6 @@ +@@ -67,7 +67,6 @@ #include "chrome/browser/printing/print_preview_dialog_controller.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.h" @@ -285,24 +302,24 @@ #include "chrome/browser/shell_integration.h" #include "chrome/browser/status_icons/status_tray.h" #include "chrome/browser/ui/browser_dialogs.h" -@@ -191,7 +190,6 @@ BrowserProcessImpl::BrowserProcessImpl( - created_local_state_(false), +@@ -196,7 +195,6 @@ BrowserProcessImpl::BrowserProcessImpl( created_icon_manager_(false), created_notification_ui_manager_(false), + created_notification_bridge_(false), - created_safe_browsing_service_(false), + created_subresource_filter_ruleset_service_(false), shutting_down_(false), tearing_down_(false), - download_status_updater_(new DownloadStatusUpdater), -@@ -268,8 +266,6 @@ void BrowserProcessImpl::StartTearDown() { - // URLFetcher operation before going away.) +@@ -280,8 +278,6 @@ void BrowserProcessImpl::StartTearDown() { + // that URLFetcher operation before going away.) metrics_services_manager_.reset(); intranet_redirect_detector_.reset(); - if (safe_browsing_service_.get()) - safe_browsing_service()->ShutDown(); + network_time_tracker_.reset(); #if defined(ENABLE_PLUGIN_INSTALLATION) plugins_resource_service_.reset(); - #endif -@@ -882,22 +878,6 @@ StatusTray* BrowserProcessImpl::status_tray() { +@@ -843,22 +839,6 @@ StatusTray* BrowserProcessImpl::status_tray() { return status_tray_.get(); } @@ -322,15 +339,15 @@ - return NULL; -} - - #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) - void BrowserProcessImpl::StartAutoupdateTimer() { - autoupdate_timer_.Start(FROM_HERE, -@@ -1151,16 +1131,6 @@ void BrowserProcessImpl::CreateBackgroundPrintingManager() { + subresource_filter::RulesetService* + BrowserProcessImpl::subresource_filter_ruleset_service() { + DCHECK(CalledOnValidThread()); +@@ -1128,16 +1108,6 @@ void BrowserProcessImpl::CreateBackgroundPrintingManager() { #endif } -void BrowserProcessImpl::CreateSafeBrowsingService() { -- DCHECK(safe_browsing_service_.get() == NULL); +- DCHECK(!safe_browsing_service_); - // Set this flag to true so that we don't retry indefinitely to - // create the service class if there was an error. - created_safe_browsing_service_ = true; @@ -339,31 +356,31 @@ - safe_browsing_service_->Initialize(); -} - - void BrowserProcessImpl::CreateGCMDriver() { - DCHECK(!gcm_driver_); - + void BrowserProcessImpl::CreateSubresourceFilterRulesetService() { + DCHECK(!subresource_filter_ruleset_service_); + created_subresource_filter_ruleset_service_ = true; --- a/chrome/browser/browser_process_impl.h +++ b/chrome/browser/browser_process_impl.h -@@ -129,9 +129,6 @@ class BrowserProcessImpl : public BrowserProcess, +@@ -126,9 +126,6 @@ class BrowserProcessImpl : public BrowserProcess, void set_background_mode_manager_for_test( - scoped_ptr manager) override; + std::unique_ptr manager) override; StatusTray* status_tray() override; - safe_browsing::SafeBrowsingService* safe_browsing_service() override; - safe_browsing::ClientSideDetectionService* safe_browsing_detection_service() - override; + subresource_filter::RulesetService* subresource_filter_ruleset_service() + override; - #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) - void StartAutoupdateTimer() override; -@@ -244,9 +241,6 @@ class BrowserProcessImpl : public BrowserProcess, - scoped_ptr background_mode_manager_; +@@ -253,9 +250,6 @@ class BrowserProcessImpl : public BrowserProcess, + std::unique_ptr background_mode_manager_; #endif - bool created_safe_browsing_service_; - scoped_refptr safe_browsing_service_; - - bool shutting_down_; - - bool tearing_down_; + bool created_subresource_filter_ruleset_service_; + std::unique_ptr + subresource_filter_ruleset_service_; --- a/chrome/browser/metrics/chrome_metrics_services_manager_client.cc +++ b/chrome/browser/metrics/chrome_metrics_services_manager_client.cc @@ -72,21 +72,7 @@ ChromeMetricsServicesManagerClient::GetURLRequestContext() { @@ -399,10 +416,10 @@ -class SafeBrowsingService; -} - - namespace variations { - class VariationsService; + namespace subresource_filter { + class RulesetService; } -@@ -107,10 +103,6 @@ namespace rappor { +@@ -111,10 +107,6 @@ namespace rappor { class RapporService; } @@ -410,10 +427,10 @@ -class ClientSideDetectionService; -} - - namespace web_resource { - class PromoResourceService; - } -@@ -217,14 +209,6 @@ class BrowserProcess { + // NOT THREAD SAFE, call only from the main thread. + // These functions shouldn't return NULL unless otherwise noted. + class BrowserProcess { +@@ -218,14 +210,6 @@ class BrowserProcess { // on this platform (or this is a unit test). virtual StatusTray* status_tray() = 0; @@ -425,47 +442,328 @@ - virtual safe_browsing::ClientSideDetectionService* - safe_browsing_detection_service() = 0; - - #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) - // This will start a timer that, if Chrome is in persistent mode, will check - // whether an update is available, and if that's the case, restart the ---- a/chrome/browser/download/download_danger_prompt.cc -+++ b/chrome/browser/download/download_danger_prompt.cc -@@ -28,10 +28,6 @@ - #include "ui/base/l10n/l10n_util.h" + // Returns the service providing versioned storage for rules used by the Safe + // Browsing subresource filter. + virtual subresource_filter::RulesetService* +--- a/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.h ++++ b/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.h +@@ -12,7 +12,6 @@ - using extensions::ExperienceSamplingEvent; --using safe_browsing::ClientDownloadResponse; --using safe_browsing::ClientSafeBrowsingReportRequest; --using safe_browsing::download_protection_util:: -- GetSBClientDownloadExtensionValueForUMA; + #include "base/macros.h" + #include "base/memory/weak_ptr.h" +-#include "chrome/browser/download/download_danger_prompt.h" + #include "chrome/browser/ui/webui/md_downloads/downloads_list_tracker.h" + #include "content/public/browser/web_contents_observer.h" + #include "content/public/browser/web_ui_message_handler.h" +@@ -113,18 +112,6 @@ class MdDownloadsDOMHandler : public content::WebContentsObserver, + // null-checking |original_notifier_|. + content::DownloadManager* GetOriginalNotifierManager() const; + +- // Displays a native prompt asking the user for confirmation after accepting +- // the dangerous download specified by |dangerous|. The function returns +- // immediately, and will invoke DangerPromptAccepted() asynchronously if the +- // user accepts the dangerous download. The native prompt will observe +- // |dangerous| until either the dialog is dismissed or |dangerous| is no +- // longer an in-progress dangerous download. +- void ShowDangerPrompt(content::DownloadItem* dangerous); +- +- // Conveys danger acceptance from the DownloadDangerPrompt to the +- // DownloadItem. +- void DangerPromptDone(int download_id, DownloadDangerPrompt::Action action); +- + // Returns true if the records of any downloaded items are allowed (and able) + // to be deleted. + bool IsDeletingHistoryAllowed(); +--- a/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc ++++ b/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc +@@ -19,7 +19,6 @@ + #include "base/threading/thread.h" + #include "base/values.h" + #include "chrome/browser/browser_process.h" +-#include "chrome/browser/download/download_danger_prompt.h" + #include "chrome/browser/download/download_history.h" + #include "chrome/browser/download/download_item_model.h" + #include "chrome/browser/download/download_prefs.h" +@@ -193,9 +192,6 @@ void MdDownloadsDOMHandler::HandleDrag(const base::ListValue* args) { + + void MdDownloadsDOMHandler::HandleSaveDangerous(const base::ListValue* args) { + CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_SAVE_DANGEROUS); +- content::DownloadItem* file = GetDownloadByValue(args); +- if (file) +- ShowDangerPrompt(file); + } + + void MdDownloadsDOMHandler::HandleDiscardDangerous( +@@ -297,12 +293,6 @@ void MdDownloadsDOMHandler::RemoveDownloads(const DownloadVector& to_remove) { + IdSet ids; + + for (auto* download : to_remove) { +- if (download->IsDangerous()) { +- // Don't allow users to revive dangerous downloads; just nuke 'em. +- download->Remove(); +- continue; +- } +- + DownloadItemModel item_model(download); + if (!item_model.ShouldShowInShelf() || + download->GetState() == content::DownloadItem::IN_PROGRESS) { +@@ -355,33 +345,6 @@ void MdDownloadsDOMHandler::FinalizeRemovals() { + } + } + +-void MdDownloadsDOMHandler::ShowDangerPrompt( +- content::DownloadItem* dangerous_item) { +- DownloadDangerPrompt* danger_prompt = DownloadDangerPrompt::Create( +- dangerous_item, +- GetWebUIWebContents(), +- false, +- base::Bind(&MdDownloadsDOMHandler::DangerPromptDone, +- weak_ptr_factory_.GetWeakPtr(), dangerous_item->GetId())); +- // danger_prompt will delete itself. +- DCHECK(danger_prompt); +-} +- +-void MdDownloadsDOMHandler::DangerPromptDone( +- int download_id, DownloadDangerPrompt::Action action) { +- if (action != DownloadDangerPrompt::ACCEPT) +- return; +- content::DownloadItem* item = NULL; +- if (GetMainNotifierManager()) +- item = GetMainNotifierManager()->GetDownload(download_id); +- if (!item && GetOriginalNotifierManager()) +- item = GetOriginalNotifierManager()->GetDownload(download_id); +- if (!item || item->IsDone()) +- return; +- CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_SAVE_DANGEROUS); +- item->ValidateDangerousDownload(); +-} +- + bool MdDownloadsDOMHandler::IsDeletingHistoryAllowed() { + content::DownloadManager* manager = GetMainNotifierManager(); + return manager && +--- a/chrome/browser/extensions/api/downloads/downloads_api.cc ++++ b/chrome/browser/extensions/api/downloads/downloads_api.cc +@@ -35,7 +35,6 @@ + #include "base/values.h" + #include "build/build_config.h" + #include "chrome/browser/browser_process.h" +-#include "chrome/browser/download/download_danger_prompt.h" + #include "chrome/browser/download/download_file_icon_extractor.h" + #include "chrome/browser/download/download_prefs.h" + #include "chrome/browser/download/download_query.h" +@@ -1237,9 +1236,6 @@ DownloadsAcceptDangerFunction::DownloadsAcceptDangerFunction() {} + + DownloadsAcceptDangerFunction::~DownloadsAcceptDangerFunction() {} + +-DownloadsAcceptDangerFunction::OnPromptCreatedCallback* +- DownloadsAcceptDangerFunction::on_prompt_created_ = NULL; +- + bool DownloadsAcceptDangerFunction::RunAsync() { + std::unique_ptr params( + downloads::AcceptDanger::Params::Create(*args_)); +@@ -1274,40 +1270,7 @@ void DownloadsAcceptDangerFunction::PromptOrWait(int download_id, int retries) { + return; + } + RecordApiFunctions(DOWNLOADS_FUNCTION_ACCEPT_DANGER); +- // DownloadDangerPrompt displays a modal dialog using native widgets that the +- // user must either accept or cancel. It cannot be scripted. +- DownloadDangerPrompt* prompt = DownloadDangerPrompt::Create( +- download_item, +- web_contents, +- true, +- base::Bind(&DownloadsAcceptDangerFunction::DangerPromptCallback, +- this, download_id)); +- // DownloadDangerPrompt deletes itself +- if (on_prompt_created_ && !on_prompt_created_->is_null()) +- on_prompt_created_->Run(prompt); +- // Function finishes in DangerPromptCallback(). +-} +- +-void DownloadsAcceptDangerFunction::DangerPromptCallback( +- int download_id, DownloadDangerPrompt::Action action) { +- DCHECK_CURRENTLY_ON(BrowserThread::UI); +- DownloadItem* download_item = +- GetDownload(GetProfile(), include_incognito(), download_id); +- if (InvalidId(download_item, &error_) || +- Fault(download_item->GetState() != DownloadItem::IN_PROGRESS, +- errors::kNotInProgress, &error_)) +- return; +- switch (action) { +- case DownloadDangerPrompt::ACCEPT: +- download_item->ValidateDangerousDownload(); +- break; +- case DownloadDangerPrompt::CANCEL: +- download_item->Remove(); +- break; +- case DownloadDangerPrompt::DISMISS: +- break; +- } +- SendResponse(error_.empty()); ++ download_item->ValidateDangerousDownload(); + } + + DownloadsShowFunction::DownloadsShowFunction() {} +--- a/chrome/browser/extensions/api/downloads/downloads_api.h ++++ b/chrome/browser/extensions/api/downloads/downloads_api.h +@@ -13,7 +13,6 @@ + #include "base/scoped_observer.h" + #include "base/time/time.h" + #include "chrome/browser/download/all_download_item_notifier.h" +-#include "chrome/browser/download/download_danger_prompt.h" + #include "chrome/browser/download/download_path_reservation_tracker.h" + #include "chrome/browser/extensions/chrome_extension_function.h" + #include "chrome/common/extensions/api/downloads.h" +@@ -193,25 +192,16 @@ class DownloadsRemoveFileFunction : public ChromeAsyncExtensionFunction { + + class DownloadsAcceptDangerFunction : public ChromeAsyncExtensionFunction { + public: +- typedef base::Callback OnPromptCreatedCallback; +- static void OnPromptCreatedForTesting( +- OnPromptCreatedCallback* callback) { +- on_prompt_created_ = callback; +- } +- + DECLARE_EXTENSION_FUNCTION("downloads.acceptDanger", DOWNLOADS_ACCEPTDANGER) + DownloadsAcceptDangerFunction(); + bool RunAsync() override; + + protected: + ~DownloadsAcceptDangerFunction() override; +- void DangerPromptCallback(int download_id, +- DownloadDangerPrompt::Action action); + + private: + void PromptOrWait(int download_id, int retries); + +- static OnPromptCreatedCallback* on_prompt_created_; + DISALLOW_COPY_AND_ASSIGN(DownloadsAcceptDangerFunction); + }; + +--- a/chrome/chrome_browser_ui.gypi ++++ b/chrome/chrome_browser_ui.gypi +@@ -981,8 +981,6 @@ + 'browser/ui/cocoa/dev_tools_controller.mm', + 'browser/ui/cocoa/download/background_theme.h', + 'browser/ui/cocoa/download/background_theme.mm', +- 'browser/ui/cocoa/download/download_danger_prompt_impl.cc', +- 'browser/ui/cocoa/download/download_danger_prompt_impl.h', + 'browser/ui/cocoa/download/download_item_button.h', + 'browser/ui/cocoa/download/download_item_button.mm', + 'browser/ui/cocoa/download/download_item_cell.h', +@@ -2284,7 +2282,6 @@ + 'browser/ui/views/constrained_web_dialog_delegate_views.cc', + 'browser/ui/views/create_application_shortcut_view.cc', + 'browser/ui/views/create_application_shortcut_view.h', +- 'browser/ui/views/download/download_danger_prompt_views.cc', + 'browser/ui/views/download/download_feedback_dialog_view.cc', + 'browser/ui/views/download/download_feedback_dialog_view.h', + 'browser/ui/views/download/download_in_progress_dialog_view.cc', +--- a/chrome/chrome_browser.gypi ++++ b/chrome/chrome_browser.gypi +@@ -1241,8 +1241,6 @@ + 'browser/download/download_commands.h', + 'browser/download/download_crx_util.cc', + 'browser/download/download_crx_util.h', +- 'browser/download/download_danger_prompt.cc', +- 'browser/download/download_danger_prompt.h', + 'browser/download/download_dir_policy_handler.cc', + 'browser/download/download_dir_policy_handler.h', + 'browser/download/download_permission_request.cc', +--- a/chrome/browser/download/download_prefs.cc ++++ b/chrome/browser/download/download_prefs.cc +@@ -49,7 +49,6 @@ + using content::BrowserContext; + using content::BrowserThread; + using content::DownloadManager; +-using safe_browsing::FileTypePolicies; namespace { -@@ -316,6 +312,7 @@ DownloadDangerPrompt* DownloadDangerPrompt::Create( - void DownloadDangerPrompt::SendSafeBrowsingDownloadRecoveryReport( - bool did_proceed, - const content::DownloadItem& download) { -+#if 0 - safe_browsing::SafeBrowsingService* sb_service = - g_browser_process->safe_browsing_service(); - ClientSafeBrowsingReportRequest report; -@@ -345,11 +342,13 @@ void DownloadDangerPrompt::SendSafeBrowsingDownloadRecoveryReport( - sb_service->SendDownloadRecoveryReport(serialized_report); - else - DLOG(ERROR) << "Unable to serialize the threat report."; -+#endif +@@ -184,13 +183,7 @@ DownloadPrefs::DownloadPrefs(Profile* profile) : profile_(profile) { + base::FilePath::StringType(1, base::FilePath::kExtensionSeparator) + + extension); + +- // Note that the list of file types that are not allowed to open +- // automatically can change in the future. When the list is tightened, it is +- // expected that some entries in the users' auto open list will get dropped +- // permanently as a result. +- if (FileTypePolicies::GetInstance()->IsAllowedToOpenAutomatically( +- filename_with_extension)) +- auto_open_.insert(extension); ++ auto_open_.insert(extension); + } } - void DownloadDangerPrompt::RecordDownloadDangerPrompt( - bool did_proceed, - const content::DownloadItem& download) { -+#if 0 - int dangerous_file_type = - GetSBClientDownloadExtensionValueForUMA(download.GetTargetFilePath()); - content::DownloadDangerType danger_type = download.GetDangerType(); -@@ -364,4 +363,5 @@ void DownloadDangerPrompt::RecordDownloadDangerPrompt( - GetDangerTypeString(danger_type)), - dangerous_file_type); - } -+#endif +@@ -315,9 +308,6 @@ bool DownloadPrefs::IsAutoOpenEnabledBasedOnExtension( + bool DownloadPrefs::EnableAutoOpenBasedOnExtension( + const base::FilePath& file_name) { + base::FilePath::StringType extension = file_name.Extension(); +- if (!FileTypePolicies::GetInstance()->IsAllowedToOpenAutomatically( +- file_name)) +- return false; + + DCHECK(extension[0] == base::FilePath::kExtensionSeparator); + extension.erase(0, 1); +--- a/chrome/browser/component_updater/file_type_policies_component_installer.cc ++++ b/chrome/browser/component_updater/file_type_policies_component_installer.cc +@@ -35,20 +35,6 @@ const uint8_t kPublicKeySHA256[32] = { + const char kFileTypePoliciesManifestName[] = "File Type Policies"; + + void LoadFileTypesFromDisk(const base::FilePath& pb_path) { +- if (pb_path.empty()) +- return; +- +- VLOG(1) << "Reading Download File Types from file: " << pb_path.value(); +- std::string binary_pb; +- if (!base::ReadFileToString(pb_path, &binary_pb)) { +- // The file won't exist on new installations, so this is not always an +- // error. +- VLOG(1) << "Failed reading from " << pb_path.value(); +- return; +- } +- +- safe_browsing::FileTypePolicies::GetInstance()->PopulateFromDynamicUpdate( +- binary_pb); } + + } // namespace +--- a/chrome/browser/download/download_target_determiner.cc ++++ b/chrome/browser/download/download_target_determiner.cc +@@ -880,24 +880,7 @@ DownloadFileType::DangerLevel DownloadTargetDeterminer::GetDangerLevel( + download_->HasUserGesture()) + return DownloadFileType::NOT_DANGEROUS; + +- DownloadFileType::DangerLevel danger_level = +- safe_browsing::FileTypePolicies::GetInstance()->GetFileDangerLevel( +- virtual_path_.BaseName()); +- +- // If the danger level is ALLOW_ON_USER_GESTURE and we have a user gesture AND +- // there was a recorded visit to the referrer prior to today, then we are +- // going to downgrade the danger_level to NOT_DANGEROUS. This prevents +- // spurious prompting for moderately dangerous files that are downloaded from +- // familiar sites. +- // TODO(asanka): Check PAGE_TRANSITION_FROM_ADDRESS_BAR bit instead of +- // comparing all bits with PageTransitionTypeIncludingQualifiersIs(). +- if (danger_level == DownloadFileType::ALLOW_ON_USER_GESTURE && +- (ui::PageTransitionTypeIncludingQualifiersIs( +- download_->GetTransitionType(), +- ui::PAGE_TRANSITION_FROM_ADDRESS_BAR) || +- (download_->HasUserGesture() && visits == VISITED_REFERRER))) +- return DownloadFileType::NOT_DANGEROUS; +- return danger_level; ++ return DownloadFileType::NOT_DANGEROUS; + } + + void DownloadTargetDeterminer::OnDownloadDestroyed( +--- a/chrome/browser/download/download_commands.cc ++++ b/chrome/browser/download/download_commands.cc +@@ -180,9 +180,6 @@ bool DownloadCommands::IsCommandEnabled(Command command) const { + // filename. Don't base an "Always open" decision based on it. Also + // exclude extensions. + return download_item_->CanOpenDownload() && +- safe_browsing::FileTypePolicies::GetInstance() +- ->IsAllowedToOpenAutomatically( +- download_item_->GetTargetFilePath()) && + !download_crx_util::IsExtensionDownload(*download_item_); + case CANCEL: + return !download_item_->IsDone(); diff --git a/resources/debian/dpkg_dir/control b/resources/debian/dpkg_dir/control index 706389e7..8c9ec0f0 100644 --- a/resources/debian/dpkg_dir/control +++ b/resources/debian/dpkg_dir/control @@ -8,7 +8,9 @@ Vcs-Git: git://anonscm.debian.org/pkg-chromium/pkg-chromium.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-chromium/pkg-chromium.git Homepage: http://www.chromium.org/Home Build-Depends: - clang (>= 3.5), +# TODO: Should we depend on a specific version of clang or the system default? +# clang (>= 3.5), + clang-3.8, debhelper (>= 9), python, pkg-config, diff --git a/resources/debian/gyp_flags b/resources/debian/gyp_flags index e8f0740f..505e869a 100644 --- a/resources/debian/gyp_flags +++ b/resources/debian/gyp_flags @@ -1,5 +1,6 @@ clang=1 clang_use_chrome_plugins=0 +make_clang_dir=/usr/lib/llvm-3.8 use_ozone=0 use_gconf=0 use_sysroot=0 @@ -13,7 +14,7 @@ linux_use_bundled_gold=0 linux_use_bundled_binutils=0 use_gnome_keyring=0 linux_link_gsettings=0 -linux_link_gnome_keyring= +linux_link_gnome_keyring=0 use_gio=1 use_pulseaudio=1 use_gtk3=1 diff --git a/resources/debian/patches/debian_system/system/clang.patch b/resources/debian/patches/debian_system/system/clang.patch deleted file mode 100644 index 529ec31e..00000000 --- a/resources/debian/patches/debian_system/system/clang.patch +++ /dev/null @@ -1,16 +0,0 @@ -description: use system clang compilers -author: Michael Gilbert - ---- a/build/common.gypi -+++ b/build/common.gypi -@@ -5985,8 +5985,8 @@ - ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) ' - 'and OS!="win"', { - 'make_global_settings': [ -- ['CC', '<(make_clang_dir)/bin/clang'], -- ['CXX', '<(make_clang_dir)/bin/clang++'], -+ ['CC', '/usr/bin/clang'], -+ ['CXX', '/usr/bin/clang++'], - ['CC.host', '$(CC)'], - ['CXX.host', '$(CXX)'], - ], diff --git a/resources/debian/patches/patch_order b/resources/debian/patches/patch_order index 8ed6b489..d90ec926 100644 --- a/resources/debian/patches/patch_order +++ b/resources/debian/patches/patch_order @@ -10,6 +10,5 @@ debian_system/master-preferences.patch debian_system/chromedriver-revision.patch debian_system/system/nspr.patch -debian_system/system/clang.patch debian_system/system/ffmpeg.patch debian_system/system/harfbuzz.patch diff --git a/resources/macos/extra_deps.ini b/resources/macos/extra_deps.ini index 7619b965..b9bdcbca 100644 --- a/resources/macos/extra_deps.ini +++ b/resources/macos/extra_deps.ini @@ -2,12 +2,7 @@ # For now, the following are from the top level DEPS file which are needed for building to work [third_party/google_toolbox_for_mac/src] -commit = 401878398253074c515c03cb3a3f8bb0cc8da6e9 +commit = e7b41fad2e7f77abf560c79f984c60d5ec6d419c url = https://github.com/google/google-toolbox-for-mac/archive/{commit}.tar.gz download_name = google-toolbox-for-mac-{commit}.tar.gz strip_leading_dirs = google-toolbox-for-mac-{commit} - -[third_party/pdfsqueeze] -commit = 5936b871e6a087b7e50d4cbcb122378d8a07499f -url = https://chromium.googlesource.com/external/pdfsqueeze.git/+archive/{commit}.tar.gz -download_name = pdfsqueeze-{commit}.tar.gz