<commit_before>#import "browser/browser_client.h"

#import "base/strings/sys_string_conversions.h"
#import "content/public/common/show_desktop_notification_params.h"

#import <Foundation/Foundation.h>

namespace brightray {

void BrowserClient::ShowDesktopNotification(
    const content::ShowDesktopNotificationHostMsgParams& params,
    int render_process_id,
    int render_view_id,
    bool worker) {
  auto notification = [[NSUserNotification alloc] init];
  notification.title = base::SysUTF16ToNSString(params.title);
  notification.informativeText = base::SysUTF16ToNSString(params.body);

  [NSUserNotificationCenter.defaultUserNotificationCenter deliverNotification:notification];
  [notification release];
}

}<commit_msg>Fire a `show` event when a notification is shown<commit_after>#import "browser/browser_client.h"

#import "base/strings/sys_string_conversions.h"
#import "content/public/browser/render_view_host.h"
#import "content/public/common/show_desktop_notification_params.h"

#import <Foundation/Foundation.h>

namespace brightray {

void BrowserClient::ShowDesktopNotification(
    const content::ShowDesktopNotificationHostMsgParams& params,
    int render_process_id,
    int render_view_id,
    bool worker) {
  auto notification = [[NSUserNotification alloc] init];
  notification.title = base::SysUTF16ToNSString(params.title);
  notification.informativeText = base::SysUTF16ToNSString(params.body);

  [NSUserNotificationCenter.defaultUserNotificationCenter deliverNotification:notification];
  [notification release];

  auto host = content::RenderViewHost::FromID(render_process_id, render_view_id);
  if (!host)
    return;

  host->DesktopNotificationPostDisplay(params.notification_id);
}

}
{'fraction_non_alphanumeric': 0.09733487833140209, 'fraction_numerical': 0.004634994206257242, 'mean_word_length': 7.070093457943925, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5899956', 'n_tokens_mistral': 505, 'n_tokens_neox': 480, 'n_words': 86}