Commit f74c2534 authored by Reid Kleckner's avatar Reid Kleckner Committed by Commit Bot

Revert "Make the ThirdPartyModulesBlocking feature work on all Windows versions"

This reverts commit 66d17ca7.

Reason for revert: This test fails in official builds:
https://uberchromegw.corp.google.com/i/official.desktop.continuous/builders/win%20trunk/builds/86110

Original change's description:
> Make the ThirdPartyModulesBlocking feature work on all Windows versions
> 
> Change-Id: I0118d26fe9b7f11f2608dd66c10418e210393733
> Reviewed-on: https://chromium-review.googlesource.com/1083842
> Commit-Queue: Patrick Monette <pmonette@chromium.org>
> Reviewed-by: Greg Thompson <grt@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#566516}

TBR=pmonette@chromium.org,grt@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Ide1a33af76247dd31b82aa3d49916fe2ec1859a4
Reviewed-on: https://chromium-review.googlesource.com/1099698Reviewed-by: default avatarReid Kleckner <rnk@chromium.org>
Commit-Queue: Reid Kleckner <rnk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566996}
parent 1b000c5b
......@@ -8,18 +8,14 @@
#include <utility>
#include "base/bind.h"
#include "base/feature_list.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "base/win/registry.h"
#include "base/win/windows_version.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/conflicts/module_database_win.h"
#include "chrome/browser/conflicts/module_info_util_win.h"
#include "chrome/browser/conflicts/module_info_win.h"
#include "chrome/browser/conflicts/module_list_filter_win.h"
#include "chrome/browser/conflicts/third_party_metrics_recorder_win.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
......@@ -227,11 +223,8 @@ void IncompatibleApplicationsUpdater::RegisterLocalStatePrefs(
// static
bool IncompatibleApplicationsUpdater::IsWarningEnabled() {
return base::win::GetVersion() >= base::win::VERSION_WIN10 &&
base::FeatureList::IsEnabled(features::kModuleDatabase) &&
ModuleDatabase::IsThirdPartyBlockingPolicyEnabled() &&
base::FeatureList::IsEnabled(
features::kIncompatibleApplicationsWarning);
return ModuleDatabase::GetInstance() &&
ModuleDatabase::GetInstance()->third_party_conflicts_manager();
}
// static
......
......@@ -49,8 +49,8 @@ class IncompatibleApplicationsUpdater : public ModuleDatabaseObserver {
static void RegisterLocalStatePrefs(PrefRegistrySimple* registry);
// Returns true if the tracking of incompatible applications is enabled. Note
// that this is a Windows 10+ feature only.
// Returns true if the tracking of incompatible applications is enabled. The
// return value will not change throughout the lifetime of the process.
static bool IsWarningEnabled();
// Returns true if the cache contains at least one incompatible application.
......
......@@ -10,6 +10,7 @@
#include "base/bind.h"
#include "base/files/file_path.h"
#include "base/location.h"
#include "base/win/windows_version.h"
#include "chrome/browser/conflicts/module_database_observer_win.h"
#if defined(GOOGLE_CHROME_BUILD)
......@@ -287,12 +288,10 @@ void ModuleDatabase::NotifyLoadedModules(ModuleDatabaseObserver* observer) {
#if defined(GOOGLE_CHROME_BUILD)
void ModuleDatabase::MaybeInitializeThirdPartyConflictsManager() {
if (!IsThirdPartyBlockingPolicyEnabled())
return;
if (base::FeatureList::IsEnabled(
features::kIncompatibleApplicationsWarning) ||
base::FeatureList::IsEnabled(features::kThirdPartyModulesBlocking)) {
if (base::win::GetVersion() >= base::win::VERSION_WIN10 &&
IsThirdPartyBlockingPolicyEnabled() &&
base::FeatureList::IsEnabled(
features::kIncompatibleApplicationsWarning)) {
third_party_conflicts_manager_ =
std::make_unique<ThirdPartyConflictsManager>(this);
AddObserver(third_party_conflicts_manager_.get());
......
......@@ -118,14 +118,13 @@ class ModuleDatabase {
#if defined(GOOGLE_CHROME_BUILD)
static void RegisterLocalStatePrefs(PrefRegistrySimple* registry);
// Returns false if third-party modules blocking is disabled via
// administrative policy.
// Returns true if the ThirdPartyBlocking policy is enabled. This can only
// return false if it is disabled via admin policy.
static bool IsThirdPartyBlockingPolicyEnabled();
// Accessor for the third party conflicts manager. This is exposed so that the
// manager can be wired up to the ThirdPartyModuleListComponentInstaller.
// Returns null if both the tracking of incompatible applications and the
// blocking of third-party modules are disabled.
// Returns null if the tracking of incompatible applications is disabled.
ThirdPartyConflictsManager* third_party_conflicts_manager() {
return third_party_conflicts_manager_.get();
}
......@@ -179,11 +178,12 @@ class ModuleDatabase {
void NotifyLoadedModules(ModuleDatabaseObserver* observer);
#if defined(GOOGLE_CHROME_BUILD)
// Initializes the ThirdPartyConflictsManager, which controls showing warnings
// for incompatible applications that inject into Chrome and the blocking of
// third-party modules. The manager is only initialized if either or both of
// the ThirdPartyModulesBlocking and IncompatibleApplicationsWarning features
// are enabled.
// Initializes the ThirdPartyConflictsManager, which controls the warning of
// incompatible applications that injects into Chrome and the blocking of
// third-party modules.
// The manager is not initialized if it is disabled via a base::Feature or a
// group policy. Note that it is also not initialized on Windows version
// 8.1 and less.
void MaybeInitializeThirdPartyConflictsManager();
void OnThirdPartyBlockingPolicyChanged();
......
......@@ -13,6 +13,7 @@
#include "base/scoped_native_library.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_reg_util_win.h"
#include "base/win/windows_version.h"
#include "chrome/browser/conflicts/incompatible_applications_updater_win.h"
#include "chrome/browser/conflicts/module_blacklist_cache_updater_win.h"
#include "chrome/browser/conflicts/module_blacklist_cache_util_win.h"
......@@ -158,6 +159,9 @@ class ThirdPartyBlockingBrowserTest : public InProcessBrowserTest {
// browser launch.
IN_PROC_BROWSER_TEST_F(ThirdPartyBlockingBrowserTest,
CreateModuleBlacklistCache) {
if (base::win::GetVersion() < base::win::VERSION_WIN10)
return;
base::FilePath module_list_path;
ASSERT_NO_FATAL_FAILURE(CreateModuleList(&module_list_path));
ASSERT_FALSE(module_list_path.empty());
......
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