Only create NotificationPresenter when succeeded to initailize toast manager

This fix crash when we failed to initailize toast manager.
This commit is contained in:
Cheng Zhao 2015-11-24 14:40:58 +08:00
parent 2468c7c34e
commit c060539562
3 changed files with 35 additions and 16 deletions

View file

@ -27,7 +27,10 @@ void RemoveNotification(base::WeakPtr<WindowsToastNotification> notification) {
// static
NotificationPresenter* NotificationPresenter::Create() {
return new NotificationPresenterWin;
if (WindowsToastNotification::Initialize())
return new NotificationPresenterWin;
else
return nullptr;
}
NotificationPresenterWin::NotificationPresenterWin() {