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