#include "chrome/browser/extensions/api/notifications/extension_notification_handler.h"
#include "base/check_op.h"
#include "base/functional/callback.h"
#include "base/metrics/histogram_macros.h"
#include "chrome/browser/extensions/api/notifications/extension_notification_display_helper.h"
#include "chrome/browser/extensions/api/notifications/extension_notification_display_helper_factory.h"
#include "chrome/browser/notifications/notification_common.h"
#include "chrome/browser/notifications/notifier_state_tracker.h"
#include "chrome/browser/notifications/notifier_state_tracker_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/extensions/api/notifications.h"
#include "extensions/browser/app_window/app_window.h"
#include "extensions/browser/app_window/app_window_registry.h"
#include "extensions/browser/app_window/native_app_window.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension_id.h"
#include "ui/message_center/public/cpp/notifier_id.h"
#include "url/gurl.h"
namespace extensions {
namespace {
base::Value::List CreateBaseEventArgs(
const ExtensionId& extension_id,
const std::string& scoped_notification_id) { … }
}
ExtensionNotificationHandler::ExtensionNotificationHandler() = default;
ExtensionNotificationHandler::~ExtensionNotificationHandler() = default;
ExtensionId ExtensionNotificationHandler::GetExtensionId(const GURL& url) { … }
void ExtensionNotificationHandler::OnClose(
Profile* profile,
const GURL& origin,
const std::string& notification_id,
bool by_user,
base::OnceClosure completed_closure) { … }
void ExtensionNotificationHandler::OnClick(
Profile* profile,
const GURL& origin,
const std::string& notification_id,
const std::optional<int>& action_index,
const std::optional<std::u16string>& reply,
base::OnceClosure completed_closure) { … }
void ExtensionNotificationHandler::DisableNotifications(Profile* profile,
const GURL& origin) { … }
void ExtensionNotificationHandler::OpenSettings(Profile* profile,
const GURL& origin) { … }
void ExtensionNotificationHandler::SendEvent(
Profile* profile,
const ExtensionId& extension_id,
events::HistogramValue histogram_value,
const std::string& event_name,
EventRouter::UserGestureState user_gesture,
base::Value::List args) { … }
}