Update background_mode_manager.cc

This commit is contained in:
Alexander David Frick 2023-01-25 01:40:08 -06:00 committed by GitHub
parent 640e2444c6
commit 75a531292b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,7 +24,6 @@
#include "base/metrics/user_metrics.h"
#include "base/one_shot_event.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
@ -372,11 +371,6 @@ BackgroundModeManager::~BackgroundModeManager() {
// static
void BackgroundModeManager::RegisterPrefs(PrefRegistrySimple* registry) {
#if BUILDFLAG(IS_MAC)
registry->RegisterBooleanPref(prefs::kUserRemovedLoginItem, false);
registry->RegisterBooleanPref(prefs::kChromeCreatedLoginItem, false);
registry->RegisterBooleanPref(prefs::kMigratedLoginItemPref, false);
#endif
registry->RegisterBooleanPref(prefs::kBackgroundModeEnabled, false);
}
@ -439,9 +433,11 @@ void BackgroundModeManager::LaunchBackgroundApplication(
#if !BUILDFLAG(IS_CHROMEOS)
apps::AppServiceProxyFactory::GetForProfile(profile)
->BrowserAppLauncher()
->LaunchAppWithParams(CreateAppLaunchParamsUserContainer(
profile, extension, WindowOpenDisposition::NEW_FOREGROUND_TAB,
apps::LaunchSource::kFromBackgroundMode));
->LaunchAppWithParams(
CreateAppLaunchParamsUserContainer(
profile, extension, WindowOpenDisposition::NEW_FOREGROUND_TAB,
apps::LaunchSource::kFromBackgroundMode),
base::DoNothing());
#else
// background mode is not used in Chrome OS platform.
// TODO(crbug.com/1291803): Remove the background mode manager from Chrome OS
@ -874,6 +870,8 @@ void BackgroundModeManager::UpdateEnableLaunchOnStartup() {
EnableLaunchOnStartup(*launch_on_startup_enabled_);
}
namespace {
// Gets the image for the status tray icon, at the correct size for the current
// platform and display settings.
gfx::ImageSkia GetStatusTrayIcon() {
@ -906,6 +904,8 @@ gfx::ImageSkia GetStatusTrayIcon() {
#endif
}
} // namespace
void BackgroundModeManager::CreateStatusTrayIcon() {
// Only need status icons on windows/linux. ChromeOS doesn't allow exiting
// Chrome and Mac can use the dock icon instead.