Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Unified Diff: chrome/browser/download/download_request_limiter.cc

Issue 2561673003: Handle per-tab AUTOMATIC_DOWNLOADS setting in DownloadRequestLimiter. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_request_limiter.cc
diff --git a/chrome/browser/download/download_request_limiter.cc b/chrome/browser/download/download_request_limiter.cc
index 85c47e992e93e1f80006e169b56a6133392eb54b..394cf7fcb80e4b1100c8eec91908e86005798221 100644
--- a/chrome/browser/download/download_request_limiter.cc
+++ b/chrome/browser/download/download_request_limiter.cc
@@ -191,6 +191,21 @@ void DownloadRequestLimiter::TabDownloadState::SetContentSetting(
settings->SetContentSettingDefaultScope(
web_contents_->GetURL(), GURL(),
CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, std::string(), setting);
+ TabSpecificContentSettings* tab_settings =
+ TabSpecificContentSettings::FromWebContents(web_contents_);
+ if (tab_settings) {
alshabalin 2016/12/08 11:39:06 This is called right after permission prompt decis
+ switch (setting) {
+ case CONTENT_SETTING_BLOCK:
+ tab_settings->SetDownloadsBlocked(true);
+ break;
+ case CONTENT_SETTING_ALLOW:
+ tab_settings->SetDownloadsBlocked(false);
+ break;
+ default:
+ // Nothing to do.
+ break;
+ }
+ }
}
void DownloadRequestLimiter::TabDownloadState::Cancel() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698