1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313
|
// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_ASH_MAIN_PARTS_CHROME_BROWSER_MAIN_PARTS_ASH_H_
#define CHROME_BROWSER_ASH_MAIN_PARTS_CHROME_BROWSER_MAIN_PARTS_ASH_H_
#include <memory>
#include "base/feature_list.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/weak_ptr.h"
#include "base/task/cancelable_task_tracker.h"
#include "chrome/browser/ash/external_metrics/external_metrics.h"
#include "chrome/browser/ash/pcie_peripheral/ash_usb_detector.h"
#include "chrome/browser/ash/performance/doze_mode_power_status_scheduler.h"
#include "chrome/browser/chrome_browser_main_linux.h"
#include "chrome/browser/memory/memory_kills_monitor.h"
class AmbientClientImpl;
class AssistantBrowserDelegateImpl;
class AssistantStateClient;
class ChromeKeyboardControllerClient;
class ImageDownloaderImpl;
class LobsterClientFactoryImpl;
namespace arc {
class ArcServiceLauncher;
class ContainerAppKiller;
} // namespace arc
namespace chromeos {
class MahiWebContentsManager;
namespace default_app_order {
class ExternalLoader;
} // namespace default_app_order
} // namespace chromeos
namespace crosapi {
class BrowserManager;
class CrosapiManager;
} // namespace crosapi
namespace crostini {
class CrostiniUnsupportedActionNotifier;
} // namespace crostini
namespace policy {
class LockToSingleUserManager;
} // namespace policy
namespace video_conference {
class VideoConferenceManagerClientImpl;
} // namespace video_conference
namespace ash {
class AccessibilityEventRewriterDelegateImpl;
class ApnMigrator;
class AudioSurveyHandler;
class BluetoothLogController;
class BluetoothPrefStateObserver;
class BulkPrintersCalculatorFactory;
class CameraGeneralSurveyHandler;
class ChromeAuthParts;
class CrosUsbDetector;
class DebugdNotificationHandler;
class EventRewriterDelegateImpl;
class FastTransitionObserver;
class FwupdDownloadClientImpl;
class GnubbyNotification;
class HatsBluetoothRevampTriggerImpl;
class IdleActionWarningObserver;
class KioskController;
class LoginScreenExtensionsStorageCleaner;
class LowDiskNotification;
class AuthEventsRecorder;
class MagicBoostControllerAsh;
class MultiCaptureNotifications;
class NetworkChangeManagerClient;
class NetworkPrefStateObserver;
class NetworkThrottlingObserver;
class MisconfiguredUserCleaner;
class PowerMetricsReporter;
class RendererFreezer;
class ReportControllerInitializer;
class SessionTerminationManager;
class ShortcutMappingPrefService;
class ShutdownPolicyForwarder;
class SigninProfileHandler;
class SuspendPerfReporter;
class SystemTokenCertDBInitializer;
class VideoConferenceAppServiceClient;
class VideoConferenceAshFeatureClient;
class DozeModePowerStatusScheduler;
class UserLoginPermissionTracker;
namespace carrier_lock {
class CarrierLockManager;
}
namespace cros_healthd::internal {
class DataCollector;
}
namespace file_manager {
class FileIndexServiceRegistry;
}
namespace internal {
class DBusServices;
}
namespace platform_keys {
class KeyPermissionsManager;
}
namespace power {
class SmartChargingManager;
namespace auto_screen_brightness {
class Controller;
}
namespace ml {
class AdaptiveScreenBrightnessManager;
}
} // namespace power
namespace quick_pair {
class QuickPairBrowserDelegateImpl;
}
namespace system {
class DarkResumeController;
} // namespace system
// ChromeBrowserMainParts implementation for chromeos specific code.
// NOTE: Chromeos UI (Ash) support should be added to
// ChromeBrowserMainExtraPartsAsh instead. This class should not depend on
// src/ash or chrome/browser/ui/ash.
class ChromeBrowserMainPartsAsh : public ChromeBrowserMainPartsLinux {
public:
ChromeBrowserMainPartsAsh(bool is_integration_test,
StartupData* startup_data);
ChromeBrowserMainPartsAsh(const ChromeBrowserMainPartsAsh&) = delete;
ChromeBrowserMainPartsAsh& operator=(const ChromeBrowserMainPartsAsh&) =
delete;
~ChromeBrowserMainPartsAsh() override;
// ChromeBrowserMainParts overrides.
int PreEarlyInitialization() override;
void PreCreateMainMessageLoop() override;
void PostCreateMainMessageLoop() override;
int PreMainMessageLoopRun() override;
// Stages called from PreMainMessageLoopRun.
void PreProfileInit() override;
void PostProfileInit(Profile* profile, bool is_initial_profile) override;
void PreBrowserStart() override;
void PostBrowserStart() override;
void PostMainMessageLoopRun() override;
void PostDestroyThreads() override;
private:
std::unique_ptr<chromeos::default_app_order::ExternalLoader>
app_order_loader_;
std::unique_ptr<NetworkPrefStateObserver> network_pref_state_observer_;
std::unique_ptr<BluetoothPrefStateObserver> bluetooth_pref_state_observer_;
std::unique_ptr<BluetoothLogController> bluetooth_log_controller_;
std::unique_ptr<IdleActionWarningObserver> idle_action_warning_observer_;
std::unique_ptr<RendererFreezer> renderer_freezer_;
std::unique_ptr<PowerMetricsReporter> power_metrics_reporter_;
std::unique_ptr<SuspendPerfReporter> suspend_perf_reporter_;
std::unique_ptr<FastTransitionObserver> fast_transition_observer_;
std::unique_ptr<NetworkThrottlingObserver> network_throttling_observer_;
std::unique_ptr<NetworkChangeManagerClient> network_change_manager_client_;
std::unique_ptr<LobsterClientFactoryImpl> lobster_client_factory_;
std::unique_ptr<DebugdNotificationHandler> debugd_notification_handler_;
std::unique_ptr<HatsBluetoothRevampTriggerImpl>
hats_bluetooth_revamp_trigger_;
std::unique_ptr<::ash::file_manager::FileIndexServiceRegistry>
file_index_service_registry_;
std::unique_ptr<internal::DBusServices> dbus_services_;
base::ScopedClosureRunner mojo_service_manager_closer_;
std::unique_ptr<SystemTokenCertDBInitializer>
system_token_certdb_initializer_;
std::unique_ptr<ShutdownPolicyForwarder> shutdown_policy_forwarder_;
std::unique_ptr<ash::UserLoginPermissionTracker>
user_login_permission_tracker_;
std::unique_ptr<EventRewriterDelegateImpl> event_rewriter_delegate_;
std::unique_ptr<carrier_lock::CarrierLockManager> carrier_lock_manager_;
// Handles event dispatch to the accessibility component extensions.
std::unique_ptr<AccessibilityEventRewriterDelegateImpl>
accessibility_event_rewriter_delegate_;
scoped_refptr<ExternalMetrics> external_metrics_;
std::unique_ptr<DozeModePowerStatusScheduler>
doze_mode_power_status_scheduler_;
std::unique_ptr<arc::ArcServiceLauncher> arc_service_launcher_;
std::unique_ptr<ImageDownloaderImpl> image_downloader_;
std::unique_ptr<AssistantStateClient> assistant_state_client_;
std::unique_ptr<AssistantBrowserDelegateImpl> assistant_delegate_;
std::unique_ptr<LowDiskNotification> low_disk_notification_;
std::unique_ptr<KioskController> kiosk_controller_;
std::unique_ptr<AmbientClientImpl> ambient_client_;
std::unique_ptr<MultiCaptureNotifications> multi_capture_notifications_;
std::unique_ptr<ShortcutMappingPrefService> shortcut_mapping_pref_service_;
std::unique_ptr<ChromeKeyboardControllerClient>
chrome_keyboard_controller_client_;
std::unique_ptr<crosapi::CrosapiManager> crosapi_manager_;
std::unique_ptr<crosapi::BrowserManager> browser_manager_;
std::unique_ptr<VideoConferenceAppServiceClient> vc_app_service_client_;
std::unique_ptr<VideoConferenceAshFeatureClient> vc_ash_feature_client_;
std::unique_ptr<power::SmartChargingManager> smart_charging_manager_;
std::unique_ptr<power::ml::AdaptiveScreenBrightnessManager>
adaptive_screen_brightness_manager_;
std::unique_ptr<power::auto_screen_brightness::Controller>
auto_screen_brightness_controller_;
std::unique_ptr<AshUsbDetector> ash_usb_detector_;
std::unique_ptr<CrosUsbDetector> cros_usb_detector_;
std::unique_ptr<ReportControllerInitializer> report_controller_initializer_;
std::unique_ptr<crostini::CrostiniUnsupportedActionNotifier>
crostini_unsupported_action_notifier_;
std::unique_ptr<system::DarkResumeController> dark_resume_controller_;
std::unique_ptr<BulkPrintersCalculatorFactory>
bulk_printers_calculator_factory_;
std::unique_ptr<FwupdDownloadClientImpl> fwupd_download_client_;
std::unique_ptr<SessionTerminationManager> session_termination_manager_;
std::unique_ptr<cros_healthd::internal::DataCollector>
cros_healthd_data_collector_;
std::unique_ptr<chromeos::MahiWebContentsManager> mahi_web_contents_manager_;
// Set when PreProfileInit() is called. If PreMainMessageLoopRun() exits
// early, this will be false during PostMainMessageLoopRun(), etc.
// Used to prevent shutting down classes that were not initialized.
bool pre_profile_init_called_ = false;
std::unique_ptr<SigninProfileHandler> signin_profile_handler_;
std::unique_ptr<policy::LockToSingleUserManager> lock_to_single_user_manager_;
std::unique_ptr<LoginScreenExtensionsStorageCleaner>
login_screen_extensions_storage_cleaner_;
std::unique_ptr<GnubbyNotification> gnubby_notification_;
std::unique_ptr<platform_keys::KeyPermissionsManager>
system_token_key_permissions_manager_;
std::unique_ptr<quick_pair::QuickPairBrowserDelegateImpl>
quick_pair_delegate_;
std::unique_ptr<AudioSurveyHandler> audio_survey_handler_;
std::unique_ptr<CameraGeneralSurveyHandler> camera_general_survey_handler_;
std::unique_ptr<ApnMigrator> apn_migrator_;
std::unique_ptr<arc::ContainerAppKiller> arc_container_app_killer_;
// Only temporarily owned, will be null after PostCreateMainMessageLoop().
// The Accessor is constructed before initialization of FeatureList and should
// only be used by ChromeFeaturesServiceProvider.
std::unique_ptr<base::FeatureList::Accessor> feature_list_accessor_;
std::unique_ptr<ash::AuthEventsRecorder> auth_events_recorder_;
std::unique_ptr<ash::ChromeAuthParts> auth_parts_;
std::unique_ptr<video_conference::VideoConferenceManagerClientImpl>
video_conference_manager_client_;
std::unique_ptr<MisconfiguredUserCleaner> misconfigured_user_cleaner_;
std::unique_ptr<ash::MagicBoostControllerAsh> magic_boost_controller_ash_;
base::WeakPtrFactory<ChromeBrowserMainPartsAsh> weak_ptr_factory_{this};
};
} // namespace ash
#endif // CHROME_BROWSER_ASH_MAIN_PARTS_CHROME_BROWSER_MAIN_PARTS_ASH_H_
|