refactor: plumb RFH instead of RPH for notifications (#28790)
This commit is contained in:
parent
37f7e66873
commit
ee8b69d067
7 changed files with 32 additions and 32 deletions
|
@ -861,10 +861,10 @@ ElectronBrowserClient::CreateBrowserMainParts(
|
|||
}
|
||||
|
||||
void ElectronBrowserClient::WebNotificationAllowed(
|
||||
int render_process_id,
|
||||
content::RenderFrameHost* rfh,
|
||||
base::OnceCallback<void(bool, bool)> callback) {
|
||||
content::WebContents* web_contents =
|
||||
WebContentsPreferences::GetWebContentsFromProcessID(render_process_id);
|
||||
content::WebContents::FromRenderFrameHost(rfh);
|
||||
if (!web_contents) {
|
||||
std::move(callback).Run(false, false);
|
||||
return;
|
||||
|
|
|
@ -54,7 +54,7 @@ class ElectronBrowserClient : public content::ContentBrowserClient,
|
|||
|
||||
NotificationPresenter* GetNotificationPresenter();
|
||||
|
||||
void WebNotificationAllowed(int render_process_id,
|
||||
void WebNotificationAllowed(content::RenderFrameHost* rfh,
|
||||
base::OnceCallback<void(bool, bool)> callback);
|
||||
|
||||
// content::NavigatorDelegate
|
||||
|
|
|
@ -78,7 +78,7 @@ PlatformNotificationService::PlatformNotificationService(
|
|||
PlatformNotificationService::~PlatformNotificationService() = default;
|
||||
|
||||
void PlatformNotificationService::DisplayNotification(
|
||||
content::RenderProcessHost* render_process_host,
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const std::string& notification_id,
|
||||
const GURL& origin,
|
||||
const GURL& document_url,
|
||||
|
@ -102,7 +102,7 @@ void PlatformNotificationService::DisplayNotification(
|
|||
auto notification = presenter->CreateNotification(delegate, notification_id);
|
||||
if (notification) {
|
||||
browser_client_->WebNotificationAllowed(
|
||||
render_process_host->GetID(),
|
||||
render_frame_host,
|
||||
base::BindRepeating(&OnWebNotificationAllowed, notification,
|
||||
notification_resources.notification_icon,
|
||||
notification_data));
|
||||
|
|
|
@ -23,7 +23,7 @@ class PlatformNotificationService
|
|||
protected:
|
||||
// content::PlatformNotificationService:
|
||||
void DisplayNotification(
|
||||
content::RenderProcessHost* render_process_host,
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const std::string& notification_id,
|
||||
const GURL& origin,
|
||||
const GURL& document_url,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue