chromium/chrome/browser/browser_process.h

// 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.

// This class is misnamed. Conceptually, this class owns features which are
// scoped to the entire process. The features must span multiple profiles. If a
// feature is scoped to a single profile it should instead be added as a
// BrowserContextKeyedServiceFactory.
//
// Historically, members of this class were lazily instantiated. Furthermore,
// some members would not be created in tests, resulting in production code
// adding nullptr checks to make tests pass. This is an anti-pattern and should
// be avoided. This is not making a statement about lazy initialization (e.g.
// performing non-trivial setup). This is about having precise lifetime
// semantics.
//
// New members should be added to GlobalFeatures, and be unconditionally
// instantiated.

#ifndef CHROME_BROWSER_BROWSER_PROCESS_H_
#define CHROME_BROWSER_BROWSER_PROCESS_H_

#include <stdint.h>

#include <memory>
#include <string>

#include "base/functional/callback_forward.h"
#include "base/memory/scoped_refptr.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/common/buildflags.h"
#include "media/media_buildflags.h"

class BackgroundModeManager;
class BrowserProcessPlatformPart;
class BuildState;
class DownloadRequestLimiter;
class DownloadStatusUpdater;
class GlobalFeatures;
class GpuModeManager;
class IconManager;
class MediaFileSystemRegistry;
class NotificationPlatformBridge;
class NotificationUIManager;
class PrefService;
class ProfileManager;
class SerialPolicyAllowedPorts;
class StartupData;
class StatusTray;
class SystemNetworkContextManager;
class WebRtcLogUploader;

#if !BUILDFLAG(IS_ANDROID)
class HidSystemTrayIcon;
class UsbSystemTrayIcon;
class IntranetRedirectDetector;
#endif

namespace embedder_support {
class OriginTrialsSettingsStorage;
}

namespace network {
class NetworkQualityTracker;
class SharedURLLoaderFactory;
}

namespace safe_browsing {
class SafeBrowsingService;
}

namespace signin {
class ActivePrimaryAccountsMetricsRecorder;
}

namespace subresource_filter {
class RulesetService;
}

namespace variations {
class VariationsService;
}

namespace component_updater {
class ComponentUpdateService;
}

namespace gcm {
class GCMDriver;
}

namespace metrics {
class MetricsService;
}

namespace metrics_services_manager {
class MetricsServicesManager;
}

namespace network_time {
class NetworkTimeTracker;
}

namespace os_crypt_async {
class KeyProvider;
class OSCryptAsync;
}

namespace policy {
class ChromeBrowserPolicyConnector;
class PolicyService;
}

namespace printing {
class BackgroundPrintingManager;
class PrintJobManager;
class PrintPreviewDialogController;
}

namespace resource_coordinator {
class ResourceCoordinatorParts;
class TabManager;
}

// NOT THREAD SAFE, call only from the main thread.
// These functions shouldn't return NULL unless otherwise noted.
class BrowserProcess {};

extern BrowserProcess* g_browser_process;

#endif  // CHROME_BROWSER_BROWSER_PROCESS_H_