electron/shell/browser/notifications/linux/notification_presenter_linux.cc
trop[bot] 3ee3844bdb
refactor: NotificationPresenter::Create() returns a std::unique_ptr<> (#43804)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-09-19 22:11:48 -05:00

28 lines
954 B
C++

// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Copyright (c) 2013 Patrick Reynolds <piki@github.com>. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE-CHROMIUM file.
#include "shell/browser/notifications/linux/notification_presenter_linux.h"
#include "shell/browser/notifications/linux/libnotify_notification.h"
namespace electron {
// static
std::unique_ptr<NotificationPresenter> NotificationPresenter::Create() {
if (LibnotifyNotification::Initialize())
return std::make_unique<NotificationPresenterLinux>();
return {};
}
NotificationPresenterLinux::NotificationPresenterLinux() = default;
NotificationPresenterLinux::~NotificationPresenterLinux() = default;
Notification* NotificationPresenterLinux::CreateNotificationObject(
NotificationDelegate* delegate) {
return new LibnotifyNotification(delegate, this);
}
} // namespace electron