#include "chrome/browser/notifications/notification_platform_bridge_delegator.h"
#include <algorithm>
#include <utility>
#include <vector>
#include "base/barrier_closure.h"
#include "base/check.h"
#include "base/functional/bind.h"
#include "base/metrics/histogram_functions.h"
#include "build/build_config.h"
#include "build/buildflag.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/notifications/notification_display_service_impl.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/buildflags.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_service.h"
#if BUILDFLAG(ENABLE_CHROME_NOTIFICATIONS)
#include "chrome/browser/notifications/notification_platform_bridge_message_center.h"
#endif
#if BUILDFLAG(IS_WIN)
#include "chrome/browser/notifications/notification_platform_bridge_win.h"
#endif
namespace {
bool SystemNotificationsEnabled(Profile* profile) { … }
NotificationPlatformBridge* GetSystemNotificationPlatformBridge(
Profile* profile) { … }
NotificationPlatformBridge* GetMessageCenterBridge() { … }
}
NotificationPlatformBridgeDelegator::NotificationPlatformBridgeDelegator(
Profile* profile,
base::OnceClosure ready_callback)
: … { … }
NotificationPlatformBridgeDelegator::~NotificationPlatformBridgeDelegator() =
default;
void NotificationPlatformBridgeDelegator::Display(
NotificationHandler::Type notification_type,
const message_center::Notification& notification,
std::unique_ptr<NotificationCommon::Metadata> metadata) { … }
void NotificationPlatformBridgeDelegator::Close(
NotificationHandler::Type notification_type,
const std::string& notification_id) { … }
void NotificationPlatformBridgeDelegator::GetDisplayed(
GetDisplayedNotificationsCallback callback) const { … }
void NotificationPlatformBridgeDelegator::GetDisplayedForOrigin(
const GURL& origin,
GetDisplayedNotificationsCallback callback) const { … }
void NotificationPlatformBridgeDelegator::DisplayServiceShutDown() { … }
NotificationPlatformBridge*
NotificationPlatformBridgeDelegator::GetBridgeForType(
NotificationHandler::Type type) { … }
void NotificationPlatformBridgeDelegator::
OnSystemNotificationPlatformBridgeReady(bool success) { … }