2020-06-27 22:43:23 +02:00
|
|
|
diff --git chrome/browser/browser_process.h chrome/browser/browser_process.h
|
2023-07-21 00:11:34 +02:00
|
|
|
index 25a82353eace8..bf3c1cc675688 100644
|
2020-06-27 22:43:23 +02:00
|
|
|
--- chrome/browser/browser_process.h
|
|
|
|
+++ chrome/browser/browser_process.h
|
2023-07-21 00:11:34 +02:00
|
|
|
@@ -203,9 +203,9 @@ class BrowserProcess {
|
2020-06-27 22:43:23 +02:00
|
|
|
virtual DownloadStatusUpdater* download_status_updater() = 0;
|
|
|
|
virtual DownloadRequestLimiter* download_request_limiter() = 0;
|
|
|
|
|
|
|
|
+#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
|
|
|
|
// Returns the object that manages background applications.
|
|
|
|
virtual BackgroundModeManager* background_mode_manager() = 0;
|
2021-03-04 23:36:57 +01:00
|
|
|
-#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
|
2020-06-27 22:43:23 +02:00
|
|
|
virtual void set_background_mode_manager_for_test(
|
|
|
|
std::unique_ptr<BackgroundModeManager> manager) = 0;
|
2021-03-04 23:36:57 +01:00
|
|
|
#endif
|
2020-06-27 22:43:23 +02:00
|
|
|
diff --git chrome/browser/browser_process_impl.cc chrome/browser/browser_process_impl.cc
|
2023-09-15 21:51:43 +02:00
|
|
|
index 080614c2c660d..8a01a0cf10dfa 100644
|
2020-06-27 22:43:23 +02:00
|
|
|
--- chrome/browser/browser_process_impl.cc
|
|
|
|
+++ chrome/browser/browser_process_impl.cc
|
2023-09-15 21:51:43 +02:00
|
|
|
@@ -1053,18 +1053,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() {
|
2020-06-27 22:43:23 +02:00
|
|
|
return download_request_limiter_.get();
|
|
|
|
}
|
|
|
|
|
2021-03-04 23:36:57 +01:00
|
|
|
-BackgroundModeManager* BrowserProcessImpl::background_mode_manager() {
|
|
|
|
#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
|
|
|
|
+BackgroundModeManager* BrowserProcessImpl::background_mode_manager() {
|
2020-06-27 22:43:23 +02:00
|
|
|
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
|
|
|
if (!background_mode_manager_)
|
|
|
|
CreateBackgroundModeManager();
|
|
|
|
return background_mode_manager_.get();
|
|
|
|
-#else
|
2021-03-04 23:36:57 +01:00
|
|
|
- return nullptr;
|
2020-06-27 22:43:23 +02:00
|
|
|
-#endif
|
|
|
|
}
|
|
|
|
|
2021-03-04 23:36:57 +01:00
|
|
|
-#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
|
2020-06-27 22:43:23 +02:00
|
|
|
void BrowserProcessImpl::set_background_mode_manager_for_test(
|
|
|
|
std::unique_ptr<BackgroundModeManager> manager) {
|
|
|
|
background_mode_manager_ = std::move(manager);
|
|
|
|
diff --git chrome/browser/browser_process_impl.h chrome/browser/browser_process_impl.h
|
2023-09-15 21:51:43 +02:00
|
|
|
index 7cc361a82a623..041225f160f89 100644
|
2020-06-27 22:43:23 +02:00
|
|
|
--- chrome/browser/browser_process_impl.h
|
|
|
|
+++ chrome/browser/browser_process_impl.h
|
2023-07-21 00:11:34 +02:00
|
|
|
@@ -185,8 +185,8 @@ class BrowserProcessImpl : public BrowserProcess,
|
2020-06-27 22:43:23 +02:00
|
|
|
void SetApplicationLocale(const std::string& actual_locale) override;
|
|
|
|
DownloadStatusUpdater* download_status_updater() override;
|
|
|
|
DownloadRequestLimiter* download_request_limiter() override;
|
2021-03-04 23:36:57 +01:00
|
|
|
- BackgroundModeManager* background_mode_manager() override;
|
|
|
|
#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
|
|
|
|
+ BackgroundModeManager* background_mode_manager() override;
|
2020-06-27 22:43:23 +02:00
|
|
|
void set_background_mode_manager_for_test(
|
|
|
|
std::unique_ptr<BackgroundModeManager> manager) override;
|
2021-03-04 23:36:57 +01:00
|
|
|
#endif
|
2020-06-27 22:43:23 +02:00
|
|
|
diff --git chrome/browser/lifetime/browser_close_manager.cc chrome/browser/lifetime/browser_close_manager.cc
|
2023-05-30 10:55:32 +02:00
|
|
|
index 1fbc225de7b84..55847e48ed0c2 100644
|
2020-06-27 22:43:23 +02:00
|
|
|
--- chrome/browser/lifetime/browser_close_manager.cc
|
|
|
|
+++ chrome/browser/lifetime/browser_close_manager.cc
|
2023-05-30 10:55:32 +02:00
|
|
|
@@ -157,12 +157,14 @@ void BrowserCloseManager::CloseBrowsers() {
|
2020-06-27 22:43:23 +02:00
|
|
|
// exit can restore all browsers open before exiting.
|
|
|
|
ProfileManager::ShutdownSessionServices();
|
|
|
|
#endif
|
|
|
|
+#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
|
|
|
|
if (!browser_shutdown::IsTryingToQuit()) {
|
|
|
|
BackgroundModeManager* background_mode_manager =
|
|
|
|
g_browser_process->background_mode_manager();
|
|
|
|
if (background_mode_manager)
|
|
|
|
background_mode_manager->SuspendBackgroundMode();
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
// Make a copy of the BrowserList to simplify the case where we need to
|
|
|
|
// destroy a Browser during the loop.
|