Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(855)

Issue 381633005: Refactor Web Notification permission requests. (Closed)

Created:
6 years, 5 months ago by Peter Beverloo
Modified:
6 years, 4 months ago
CC:
chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, jam, nasko+codewatch_chromium.org, tkent
Project:
chromium
Visibility:
Public.

Description

Refactor Web Notification permission requests. As part of supporting Web Notifications in workers, only the ability to request permission will be done through a WebFrame, all other operations will be routed through Platform. This patch introduces the NotificationPermissionDispatcher, (lazy) member of RenderFrameImpl, handling that sole responsibility. The NPD will replace the existing NotificationProvider in its entirety. However, while moving functionality around, we need to maintain the existing code paths and thus use this opportunity to rename DesktopNotifications to a more generic PlatformNotifications, since they'll also be usable on Android. When a website currently requests permission to display Web Notifications, we show an infobar to the user, then send a message (without result!) to the renderer process, where a synchronous IPC to the browser process will fire in order to find out whether permission was actually granted. This patch includes whether permission was granted in the first message. BUG=392187, 398045 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=286321

Patch Set 1 #

Total comments: 3

Patch Set 2 : rebase #

Total comments: 2

Patch Set 3 : rebase #

Patch Set 4 : #

Patch Set 5 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+187 lines, -0 lines) Patch
M content/browser/frame_host/render_frame_host_impl.h View 1 2 3 4 2 chunks +4 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.cc View 1 2 3 4 4 chunks +24 lines, -0 lines 0 comments Download
M content/common/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
M content/common/content_message_generator.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A content/common/platform_notification_messages.h View 1 chunk +30 lines, -0 lines 0 comments Download
M content/content_common.gypi View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M content/content_renderer.gypi View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
A content/renderer/notification_permission_dispatcher.h View 1 chunk +50 lines, -0 lines 0 comments Download
A content/renderer/notification_permission_dispatcher.cc View 1 chunk +52 lines, -0 lines 0 comments Download
M content/renderer/render_frame_impl.h View 1 2 3 4 3 chunks +8 lines, -0 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 3 chunks +13 lines, -0 lines 0 comments Download
M ipc/ipc_message_start.h View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
Michael van Ouwerkerk
lgtm with nit https://codereview.chromium.org/381633005/diff/1/content/renderer/notification_permission_dispatcher.cc File content/renderer/notification_permission_dispatcher.cc (right): https://codereview.chromium.org/381633005/diff/1/content/renderer/notification_permission_dispatcher.cc#newcode27 content/renderer/notification_permission_dispatcher.cc:27: routing_id(), GURL(origin.toString()), request_id)); Where is the ...
6 years, 5 months ago (2014-07-10 10:53:11 UTC) #1
Peter Beverloo
+stevenjb for s/DesktopNotification/PlatformNotification/, and general Notification ownership. +jochen for content/ I'll add an IPC reviewer ...
6 years, 5 months ago (2014-07-15 16:33:30 UTC) #2
stevenjb
-> mukai@ who has been working on notifications more recently than I.
6 years, 5 months ago (2014-07-15 19:15:55 UTC) #3
Jun Mukai
I think stevenjb is still more familiar with the permission code and ipc, but anyways. ...
6 years, 5 months ago (2014-07-15 21:49:32 UTC) #4
Peter Beverloo
https://codereview.chromium.org/381633005/diff/20001/content/browser/frame_host/render_frame_host_impl.cc File content/browser/frame_host/render_frame_host_impl.cc (right): https://codereview.chromium.org/381633005/diff/20001/content/browser/frame_host/render_frame_host_impl.cc#newcode952 content/browser/frame_host/render_frame_host_impl.cc:952: blink::WebNotificationPermissionAllowed; On 2014/07/15 21:49:32, Jun Mukai wrote: > Should ...
6 years, 5 months ago (2014-07-15 21:53:48 UTC) #5
stevenjb
Hmm, I really don't know anything about notification permissions, so we may need to add ...
6 years, 5 months ago (2014-07-15 21:59:50 UTC) #6
Peter Beverloo
+Andrew who might also have opinions. I'd argue that this patch comes closer to content/ ...
6 years, 5 months ago (2014-07-15 22:09:01 UTC) #7
jochen (gone - plz use gerrit)
fyi, https://codereview.chromium.org/398163008/
6 years, 5 months ago (2014-07-17 09:32:47 UTC) #8
Jun Mukai
hmm, no one so far replied, which may indicate no one remembers the strong reason ...
6 years, 5 months ago (2014-07-22 00:05:48 UTC) #9
jochen (gone - plz use gerrit)
lgtm https://codereview.chromium.org/381633005/diff/1/content/renderer/notification_permission_dispatcher.cc File content/renderer/notification_permission_dispatcher.cc (right): https://codereview.chromium.org/381633005/diff/1/content/renderer/notification_permission_dispatcher.cc#newcode27 content/renderer/notification_permission_dispatcher.cc:27: routing_id(), GURL(origin.toString()), request_id)); On 2014/07/15 16:33:30, Peter Beverloo ...
6 years, 5 months ago (2014-07-22 11:35:24 UTC) #10
Peter Beverloo
On 2014/07/22 00:05:48, Jun Mukai wrote: > hmm, no one so far replied, which may ...
6 years, 4 months ago (2014-07-28 16:40:46 UTC) #11
Peter Beverloo
+palmer for IPC. The duplication will be gone promply. To clarify: - This CL depends ...
6 years, 4 months ago (2014-07-28 16:45:13 UTC) #12
palmer
lgtm
6 years, 4 months ago (2014-07-28 18:55:51 UTC) #13
Peter Beverloo
The CQ bit was checked by peter@chromium.org
6 years, 4 months ago (2014-07-29 19:00:11 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/peter@chromium.org/381633005/80001
6 years, 4 months ago (2014-07-29 19:02:53 UTC) #15
commit-bot: I haz the power
6 years, 4 months ago (2014-07-29 22:40:13 UTC) #16
Message was sent while issue was closed.
Change committed as 286321

Powered by Google App Engine
This is Rietveld 408576698