Skip to content

Commit

Permalink
fix dut to changed prototype of WebNotificationAllowed
Browse files Browse the repository at this point in the history
  • Loading branch information
yurii.lozytskyi committed Sep 25, 2022
1 parent fea5321 commit 1d5208c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion shell/browser/electron_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ absl::optional<int> ElectronBrowserClient::GetRenderFrameProcessID() {
notifications_allowed = notifications_allowed_;
};
WebNotificationAllowed(
GetWebContentsFromProcessID(proc_id),
GetWebContentsFromProcessID(proc_id)->GetPrimaryMainFrame(),
base::BindRepeating(
[](std::function<void(bool, bool)> process_flags_,
// flags below will come from WebNotificationAllowed
Expand Down
3 changes: 2 additions & 1 deletion shell/browser/electron_browser_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ class ElectronBrowserClient : public content::ContentBrowserClient,

NotificationPresenter* GetNotificationPresenter();

void WebNotificationAllowed(content::WebContents* web_contents,
void WebNotificationAllowed(content::RenderFrameHost* rfh,
// content::WebContents* web_contents,
base::OnceCallback<void(bool, bool)> callback);

// content::NavigatorDelegate
Expand Down
5 changes: 3 additions & 2 deletions shell/browser/notifications/platform_notification_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ void PlatformNotificationService::DisplayNotification(
const bool is_persistent(false);
const bool is_replacing(prev_notif_count > curr_notif_count);
browser_client_->WebNotificationAllowed(
content::WebContents::FromRenderFrameHost(render_frame_host),
// content::WebContents::FromRenderFrameHost(render_frame_host),
render_frame_host,
base::BindRepeating(&OnWebNotificationAllowed, notification,
notification_resources.notification_icon,
notification_resources.image, notification_data,
Expand Down Expand Up @@ -243,7 +244,7 @@ void PlatformNotificationService::DisplayPersistentNotification(
const bool is_persistent(true);
const bool is_replacing(prev_notif_count > curr_notif_count);
browser_client_->WebNotificationAllowed(
web_ctx,
web_ctx->GetPrimaryMainFrame(),
base::BindRepeating(&OnWebNotificationAllowed, notification,
notification_resources.notification_icon,
notification_resources.image, notification_data,
Expand Down

0 comments on commit 1d5208c

Please sign in to comment.