refactor: NotificationPresenter::Create() returns a std::unique_ptr<> (#43794)
This commit is contained in:
parent
855f219301
commit
d100921289
5 changed files with 14 additions and 14 deletions
|
@ -42,17 +42,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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue