refactor: NotificationPresenter::Create() returns a std::unique_ptr<> (#43806)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
trop[bot] 2024-09-19 22:11:59 -05:00 committed by GitHub
parent 08579bdcd5
commit 2bc8797fed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 14 additions and 14 deletions

View file

@ -46,17 +46,17 @@ bool SaveIconToPath(const SkBitmap& bitmap, const base::FilePath& path) {
} // namespace
// static
NotificationPresenter* NotificationPresenter::Create() {
std::unique_ptr<NotificationPresenter> NotificationPresenter::Create() {
if (!WindowsToastNotification::Initialize())
return nullptr;
return {};
auto presenter = std::make_unique<NotificationPresenterWin>();
if (!presenter->Init())
return nullptr;
return {};
if (IsDebuggingNotifications())
LOG(INFO) << "Successfully created Windows notifications presenter";
return presenter.release();
return presenter;
}
NotificationPresenterWin::NotificationPresenterWin() = default;