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

Unified Diff: chrome/test/base/testing_browser_process.cc

Issue 1786263002: Remove uses of ENABLE_CONFIGURATION_POLICY from src/chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sort Created 4 years, 9 months 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 | « chrome/test/base/testing_browser_process.h ('k') | chrome/test/base/testing_profile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/testing_browser_process.cc
diff --git a/chrome/test/base/testing_browser_process.cc b/chrome/test/base/testing_browser_process.cc
index 404e3f3412dbdc219f3b937f9b63b7e175825af1..4f2cd474d7245346e43f11049370bd633dae2ca1 100644
--- a/chrome/test/base/testing_browser_process.cc
+++ b/chrome/test/base/testing_browser_process.cc
@@ -17,23 +17,17 @@
#include "chrome/common/features.h"
#include "chrome/test/base/testing_browser_process_platform_part.h"
#include "components/network_time/network_time_tracker.h"
+#include "components/policy/core/browser/browser_policy_connector.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/notification_service.h"
#include "net/url_request/url_request_context_getter.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/message_center/message_center.h"
-
#if BUILDFLAG(ENABLE_BACKGROUND)
#include "chrome/browser/background/background_mode_manager.h"
#endif
-#if defined(ENABLE_CONFIGURATION_POLICY)
-#include "components/policy/core/browser/browser_policy_connector.h"
-#else
-#include "components/policy/core/common/policy_service_stub.h"
-#endif // defined(ENABLE_CONFIGURATION_POLICY)
-
#if defined(ENABLE_EXTENSIONS)
#include "chrome/browser/extensions/chrome_extensions_browser_client.h"
#include "chrome/browser/media_galleries/media_file_system_registry.h"
@@ -85,9 +79,7 @@ TestingBrowserProcess::TestingBrowserProcess()
TestingBrowserProcess::~TestingBrowserProcess() {
EXPECT_FALSE(local_state_);
-#if defined(ENABLE_CONFIGURATION_POLICY)
ShutdownBrowserPolicyConnector();
-#endif
#if defined(ENABLE_EXTENSIONS)
extensions::ExtensionsBrowserClient::Set(nullptr);
#endif
@@ -154,26 +146,16 @@ TestingBrowserProcess::promo_resource_service() {
policy::BrowserPolicyConnector*
TestingBrowserProcess::browser_policy_connector() {
-#if defined(ENABLE_CONFIGURATION_POLICY)
if (!browser_policy_connector_) {
EXPECT_FALSE(created_browser_policy_connector_);
created_browser_policy_connector_ = true;
browser_policy_connector_ = platform_part_->CreateBrowserPolicyConnector();
}
return browser_policy_connector_.get();
-#else
- return nullptr;
-#endif
}
policy::PolicyService* TestingBrowserProcess::policy_service() {
-#if defined(ENABLE_CONFIGURATION_POLICY)
return browser_policy_connector()->GetPolicyService();
-#else
- if (!policy_service_)
- policy_service_.reset(new policy::PolicyServiceStub());
- return policy_service_.get();
-#endif
}
IconManager* TestingBrowserProcess::icon_manager() {
@@ -411,10 +393,8 @@ void TestingBrowserProcess::SetLocalState(PrefService* local_state) {
// are also freed.
network_time_tracker_.reset();
notification_ui_manager_.reset();
-#if defined(ENABLE_CONFIGURATION_POLICY)
ShutdownBrowserPolicyConnector();
created_browser_policy_connector_ = false;
-#endif
}
local_state_ = local_state;
}
@@ -424,13 +404,9 @@ void TestingBrowserProcess::SetIOThread(IOThread* io_thread) {
}
void TestingBrowserProcess::ShutdownBrowserPolicyConnector() {
-#if defined(ENABLE_CONFIGURATION_POLICY)
if (browser_policy_connector_)
browser_policy_connector_->Shutdown();
browser_policy_connector_.reset();
-#else
- CHECK(false);
-#endif
}
void TestingBrowserProcess::SetSafeBrowsingService(
« no previous file with comments | « chrome/test/base/testing_browser_process.h ('k') | chrome/test/base/testing_profile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698