Commit be728e56 authored by Tibor Goldschwendt's avatar Tibor Goldschwendt Committed by Commit Bot

[webui][ntp] Restrict network access if OGB is iframed

The WebUI NTP is temporarily allowed to make network requests to support
the inlined OGB. The inlined OGB will soon be replaced by an iframed
OGB, which can be activated via the #ntp-iframe-one-google-bar feature
flag. This CL restricts network access for the WebUI NTP if this flag is
enabled so that we don't inadvertently rely on network access for other
features such as NTP modules.

Bug: 1076506
Change-Id: I567d75dbfc083a4623d1f420f1d14ed9ef655def
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2375729
Auto-Submit: Tibor Goldschwendt <tiborg@chromium.org>
Reviewed-by: default avatarEsmael Elmoslimany <aee@chromium.org>
Commit-Queue: Esmael Elmoslimany <aee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801607}
parent ca750be7
......@@ -23,6 +23,7 @@
#include "chrome/browser/media/media_engagement_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/search/ntp_features.h"
#include "chrome/browser/search/suggestions/suggestions_ui.h"
#include "chrome/browser/ui/webui/about_ui.h"
#include "chrome/browser/ui/webui/autofill_and_password_manager_internals/autofill_internals_ui.h"
......@@ -1018,7 +1019,8 @@ bool ChromeWebUIControllerFactory::IsWebUIAllowedToMakeNetworkRequests(
// https://crbug.com/859345
origin.host() == chrome::kChromeUIDownloadsHost ||
// TODO(crbug.com/1076506): remove when change to iframed OneGoogleBar.
origin.host() == chrome::kChromeUINewTabPageHost;
(origin.host() == chrome::kChromeUINewTabPageHost &&
!base::FeatureList::IsEnabled(ntp_features::kIframeOneGoogleBar));
}
ChromeWebUIControllerFactory::ChromeWebUIControllerFactory() = default;
......
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