Add IsEmpty helper and remove GetInstance public usage

This commit is contained in:
Kevin Sawicki 2017-04-06 14:48:58 -07:00
parent da5d7d72b0
commit e7b679ead6
4 changed files with 14 additions and 13 deletions

View file

@ -87,14 +87,13 @@ void AutoUpdater::SetFeedURL(const std::string& url, mate::Arguments* args) {
void AutoUpdater::QuitAndInstall() {
// If we don't have any window then quitAndInstall immediately.
WindowList* window_list = WindowList::GetInstance();
if (window_list->empty()) {
if (WindowList::IsEmpty()) {
auto_updater::AutoUpdater::QuitAndInstall();
return;
}
// Otherwise do the restart after all windows have been closed.
window_list->AddObserver(this);
WindowList::AddObserver(this);
WindowList::CloseAllWindows();
}