Commit a12697ca authored by Tim Volodine's avatar Tim Volodine Committed by Commit Bot

[WebLayer] Align real-time URL checks setting with chrome

Do not enable real-time URL checks functionality when
Safe Browsing is disabled. Also add documentation regarding
this in WebLayer API.

Note:
Real-time URL checks can technically be enabled separately from
the standard safe browsing, but this applies to enterprise users
using Chrome Browser Cloud Management. This use case is currently
only supported on Desktop platforms. It does not apply to Chrome
on Android and WebLayer.

BUG=1106358

Change-Id: Ib181aec6ed9466958d2a36eca83553fd33dc662b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2302854Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Commit-Queue: Tim Volodine <timvolodine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#789988}
parent 42e67c12
......@@ -371,6 +371,7 @@ ContentBrowserClientImpl::CreateURLLoaderThrottles(
BrowserContextImpl* browser_context_impl =
static_cast<BrowserContextImpl*>(browser_context);
bool is_real_time_lookup_enabled =
!GetSafeBrowsingService()->GetSafeBrowsingDisabled() &&
safe_browsing::RealTimePolicyEngine::CanPerformFullURLLookup(
browser_context_impl->pref_service(),
browser_context_impl->IsOffTheRecord(),
......
......@@ -244,4 +244,8 @@ SafeBrowsingService::GetURLLoaderFactory() {
return network_context_->GetURLLoaderFactory();
}
bool SafeBrowsingService::GetSafeBrowsingDisabled() {
return safe_browsing_disabled_;
}
} // namespace weblayer
......@@ -58,6 +58,7 @@ class SafeBrowsingService {
content::RenderProcessHost* render_process_host);
void StopDBManager();
void SetSafeBrowsingDisabled(bool disabled);
bool GetSafeBrowsingDisabled();
scoped_refptr<network::SharedURLLoaderFactory> GetURLLoaderFactory();
private:
......
......@@ -42,6 +42,9 @@ public @interface SettingType {
* checkbox in the Safe Browsing interstitial which is displayed when the user encounters a
* dangerous web page. The setting persists on disk.
*
* Note: this setting applies when Safe Browsing is enabled (i.e. BASIC_SAFE_BROWSING_ENABLED
* is true).
*
* @since 85
*/
int EXTENDED_REPORTING_SAFE_BROWSING_ENABLED =
......@@ -52,6 +55,9 @@ public @interface SettingType {
* Allows the embedder to set whether it wants to enable/disable the Safe Browsing Real-time URL
* checks. This functionality is disabled by default.
*
* Note: this setting applies when Safe Browsing is enabled (i.e. BASIC_SAFE_BROWSING_ENABLED
* is true).
*
* @since 85
*/
int REAL_TIME_SAFE_BROWSING_ENABLED =
......
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