Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #205 from felixrieseberg/fix-win-not
Browse files Browse the repository at this point in the history
[Windows] Notify only when enabled
  • Loading branch information
zcbenz committed Mar 17, 2016
2 parents c7abfaa + 8a9f287 commit 242feb1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion browser/win/windows_toast_notification.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,16 @@ void WindowsToastNotification::Show(
const bool silent) {
auto presenter_win = static_cast<NotificationPresenterWin*>(presenter());
std::wstring icon_path = presenter_win->SaveIconToFilesystem(icon, icon_url);


// Ask Windows for the current notification settings
// If not allowed, we return here (0 = enabled)
ABI::Windows::UI::Notifications::NotificationSetting setting;
toast_notifier_->get_Setting(&setting);
if (setting != 0) {
NotificationFailed();
return;
}

ComPtr<IXmlDocument> toast_xml;
if(FAILED(GetToastXml(toast_manager_.Get(), title, msg, icon_path, silent, &toast_xml))) {
NotificationFailed();
Expand Down

0 comments on commit 242feb1

Please sign in to comment.