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

Issue 866443003: Push API: Don't require notification if tab is visible. (Closed)

Created:
5 years, 11 months ago by johnme
Modified:
5 years, 10 months ago
CC:
chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, jam, nasko+codewatch_chromium.org, zea+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@ycm_outdir
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Push API: Don't require notification if tab is visible. For developers who have opted in to showing a user-visible UI change on every push (in exchange for showing the user a less scary permission prompt), we currently[1] enforce that each push shows a notification. This patch relaxes the requirement slightly, so that sites don't need to show user-visible UI if a same-origin-ish[2] tab is currently visible, i.e. is the active tab of a non-minimized window. That's because updating the UI of such a tab instead of showing a notification is a valid way to show user-visible UI. See also: - https://crbug.com/437277 - http://lists.w3.org/Archives/Public/public-webapps/2014OctDec/0214.html - https://github.com/w3c/push-api/pull/87 [1]: (since https://codereview.chromium.org/842233003) [2]: (see comment in push_messaging_service_impl.cc) BUG=437277 Committed: https://crrev.com/266a9e0aa173d6bffbc6484d09c6407c096e6ac3 Cr-Commit-Position: refs/heads/master@{#314586}

Patch Set 1 #

Total comments: 8

Patch Set 2 : Added push_messaging_service.cc #

Total comments: 1

Patch Set 3 : Address Michael's review comments #

Total comments: 4

Patch Set 4 : Add {} #

Patch Set 5 : Expose WebContents::IsHiddenIgnoringCapturing instead of PushMessagingService::IsWebContentsUserVis… #

Total comments: 1

Patch Set 6 : Use active_web_contents->GetMainFrame()->GetVisibilityState() #

Total comments: 2

Patch Set 7 : Switch statement for GetVisibilityState #

Total comments: 16

Patch Set 8 : Addressed Mounir's review comments #

Total comments: 2

Patch Set 9 : Fix Android compile #

Unified diffs Side-by-side diffs Delta from patch set Stats (+101 lines, -8 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabList.java View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/services/gcm/push_messaging_browsertest.cc View 1 2 3 4 5 5 chunks +33 lines, -8 lines 0 comments Download
M chrome/browser/services/gcm/push_messaging_service_impl.cc View 1 2 3 4 5 6 7 8 2 chunks +55 lines, -0 lines 0 comments Download
M chrome/browser/ui/android/tab_model/tab_model.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/android/tab_model/tab_model.cc View 1 2 2 chunks +11 lines, -0 lines 0 comments Download

Messages

Total messages: 40 (9 generated)
Michael van Ouwerkerk
https://codereview.chromium.org/866443003/diff/1/chrome/browser/services/gcm/push_messaging_service_impl.cc File chrome/browser/services/gcm/push_messaging_service_impl.cc (right): https://codereview.chromium.org/866443003/diff/1/chrome/browser/services/gcm/push_messaging_service_impl.cc#newcode269 chrome/browser/services/gcm/push_messaging_service_impl.cc:269: // as even with navigator.connect the Service Worker can't ...
5 years, 11 months ago (2015-01-21 19:13:22 UTC) #2
Michael van Ouwerkerk
https://codereview.chromium.org/866443003/diff/20001/content/public/browser/push_messaging_service.cc File content/public/browser/push_messaging_service.cc (right): https://codereview.chromium.org/866443003/diff/20001/content/public/browser/push_messaging_service.cc#newcode12 content/public/browser/push_messaging_service.cc:12: bool PushMessagingService::IsWebContentsUserVisible( Shouldn't this just be a method of ...
5 years, 11 months ago (2015-01-21 19:16:34 UTC) #3
johnme
https://codereview.chromium.org/866443003/diff/1/chrome/browser/services/gcm/push_messaging_service_impl.cc File chrome/browser/services/gcm/push_messaging_service_impl.cc (right): https://codereview.chromium.org/866443003/diff/1/chrome/browser/services/gcm/push_messaging_service_impl.cc#newcode269 chrome/browser/services/gcm/push_messaging_service_impl.cc:269: // as even with navigator.connect the Service Worker can't ...
5 years, 11 months ago (2015-01-21 19:32:19 UTC) #4
johnme
dtrainor@chromium.org: please review TabList.java and tab_model.{h,cc} avi@chromium.org: please review content/, especially push_messaging_service.cc which feels a ...
5 years, 11 months ago (2015-01-21 19:38:01 UTC) #6
johnme
Swapping avi@ for jochen@ as he's OOO. jochen@chromium.org: please review content/, especially push_messaging_service.cc which feels ...
5 years, 11 months ago (2015-01-21 19:40:48 UTC) #9
jochen (gone - plz use gerrit)
i don't really understand what this change is supposed to do? Can you elaborate on ...
5 years, 11 months ago (2015-01-22 16:23:19 UTC) #10
johnme
On 2015/01/22 16:23:19, jochen (slow) wrote: > i don't really understand what this change is ...
5 years, 11 months ago (2015-01-22 17:27:44 UTC) #11
David Trainor- moved to gerrit
chrome/android/java and chrome/browser/ui/android lgtm. I don't know about the feature/code area for the rest so ...
5 years, 11 months ago (2015-01-22 18:56:15 UTC) #12
jochen (gone - plz use gerrit)
the comment on WebContentsImpl::should_normally_be_visible_ makes me wonder whether that's really what you want. +skuhne, who ...
5 years, 11 months ago (2015-01-23 14:16:34 UTC) #14
johnme
On 2015/01/23 14:16:34, jochen (slow) wrote: > the comment on WebContentsImpl::should_normally_be_visible_ makes me wonder > ...
5 years, 11 months ago (2015-01-23 15:08:39 UTC) #15
johnme
On 2015/01/23 14:16:34, jochen (slow) wrote: > In any case, I think if this is ...
5 years, 11 months ago (2015-01-23 16:01:55 UTC) #16
mlamouri (slow - plz ping)
https://codereview.chromium.org/866443003/diff/80001/chrome/browser/services/gcm/push_messaging_service_impl.cc File chrome/browser/services/gcm/push_messaging_service_impl.cc (right): https://codereview.chromium.org/866443003/diff/80001/chrome/browser/services/gcm/push_messaging_service_impl.cc#newcode275 chrome/browser/services/gcm/push_messaging_service_impl.cc:275: // as even with navigator.connect the Service Worker can't ...
5 years, 11 months ago (2015-01-26 11:53:35 UTC) #18
johnme
On 2015/01/26 11:53:35, Mounir Lamouri wrote: > https://codereview.chromium.org/866443003/diff/80001/chrome/browser/services/gcm/push_messaging_service_impl.cc#newcode275 > chrome/browser/services/gcm/push_messaging_service_impl.cc:275: // as even with > ...
5 years, 11 months ago (2015-01-26 14:07:09 UTC) #19
jochen (gone - plz use gerrit)
i wonder whether it's possible to base this on top of https://codereview.chromium.org/871443004 ?
5 years, 11 months ago (2015-01-26 16:19:29 UTC) #20
mlamouri (slow - plz ping)
On 2015/01/26 at 16:19:29, jochen wrote: > i wonder whether it's possible to base this ...
5 years, 11 months ago (2015-01-26 16:27:03 UTC) #21
johnme
On 2015/01/26 16:27:03, Mounir Lamouri wrote: > On 2015/01/26 at 16:19:29, jochen wrote: > > ...
5 years, 11 months ago (2015-01-26 16:57:43 UTC) #22
mlamouri (slow - plz ping)
On 2015/01/26 at 16:57:43, johnme wrote: > On 2015/01/26 16:27:03, Mounir Lamouri wrote: > > ...
5 years, 11 months ago (2015-01-26 17:42:06 UTC) #23
jochen (gone - plz use gerrit)
On 2015/01/26 at 16:57:43, johnme wrote: > On 2015/01/26 16:27:03, Mounir Lamouri wrote: > > ...
5 years, 11 months ago (2015-01-27 09:55:57 UTC) #24
johnme
On 2015/01/26 17:42:06, Mounir Lamouri wrote: > On 2015/01/26 at 16:57:43, johnme wrote: > > ...
5 years, 10 months ago (2015-01-27 21:05:13 UTC) #25
mlamouri (slow - plz ping)
https://codereview.chromium.org/866443003/diff/100001/chrome/browser/services/gcm/push_messaging_service_impl.cc File chrome/browser/services/gcm/push_messaging_service_impl.cc (right): https://codereview.chromium.org/866443003/diff/100001/chrome/browser/services/gcm/push_messaging_service_impl.cc#newcode278 chrome/browser/services/gcm/push_messaging_service_impl.cc:278: != blink::WebPageVisibilityStateVisible) I thought I had left a comment ...
5 years, 10 months ago (2015-01-28 09:26:57 UTC) #26
johnme
https://codereview.chromium.org/866443003/diff/100001/chrome/browser/services/gcm/push_messaging_service_impl.cc File chrome/browser/services/gcm/push_messaging_service_impl.cc (right): https://codereview.chromium.org/866443003/diff/100001/chrome/browser/services/gcm/push_messaging_service_impl.cc#newcode278 chrome/browser/services/gcm/push_messaging_service_impl.cc:278: != blink::WebPageVisibilityStateVisible) On 2015/01/28 09:26:57, Mounir Lamouri wrote: > ...
5 years, 10 months ago (2015-02-02 12:14:04 UTC) #27
mlamouri (slow - plz ping)
Looks good. Should be fine with the comments applied. https://codereview.chromium.org/866443003/diff/120001/chrome/browser/services/gcm/push_messaging_browsertest.cc File chrome/browser/services/gcm/push_messaging_browsertest.cc (right): https://codereview.chromium.org/866443003/diff/120001/chrome/browser/services/gcm/push_messaging_browsertest.cc#newcode175 chrome/browser/services/gcm/push_messaging_browsertest.cc:175: ...
5 years, 10 months ago (2015-02-02 12:36:58 UTC) #28
johnme
Addressed Mounir's review comments https://codereview.chromium.org/866443003/diff/120001/chrome/browser/services/gcm/push_messaging_browsertest.cc File chrome/browser/services/gcm/push_messaging_browsertest.cc (right): https://codereview.chromium.org/866443003/diff/120001/chrome/browser/services/gcm/push_messaging_browsertest.cc#newcode175 chrome/browser/services/gcm/push_messaging_browsertest.cc:175: } On 2015/02/02 12:36:57, Mounir ...
5 years, 10 months ago (2015-02-02 15:58:37 UTC) #29
mlamouri (slow - plz ping)
non-owner lgtm https://codereview.chromium.org/866443003/diff/120001/chrome/browser/services/gcm/push_messaging_browsertest.cc File chrome/browser/services/gcm/push_messaging_browsertest.cc (right): https://codereview.chromium.org/866443003/diff/120001/chrome/browser/services/gcm/push_messaging_browsertest.cc#newcode175 chrome/browser/services/gcm/push_messaging_browsertest.cc:175: } On 2015/02/02 at 15:58:36, johnme wrote: ...
5 years, 10 months ago (2015-02-02 16:23:36 UTC) #30
Michael van Ouwerkerk
lgtm with nit https://codereview.chromium.org/866443003/diff/140001/chrome/browser/services/gcm/push_messaging_service_impl.cc File chrome/browser/services/gcm/push_messaging_service_impl.cc (right): https://codereview.chromium.org/866443003/diff/140001/chrome/browser/services/gcm/push_messaging_service_impl.cc#newcode244 chrome/browser/services/gcm/push_messaging_service_impl.cc:244: // TODO(johnme): Relax this heuristic slightly. ...
5 years, 10 months ago (2015-02-03 15:15:54 UTC) #31
johnme
Now that this no longer touches content/, jochen said he's happy to leave the owners ...
5 years, 10 months ago (2015-02-03 17:03:40 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/866443003/140001
5 years, 10 months ago (2015-02-03 17:04:11 UTC) #34
commit-bot: I haz the power
Try jobs failed on following builders: android_chromium_gn_compile_rel on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_rel/builds/55328)
5 years, 10 months ago (2015-02-03 17:12:47 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/866443003/160001
5 years, 10 months ago (2015-02-04 17:02:10 UTC) #38
commit-bot: I haz the power
Committed patchset #9 (id:160001)
5 years, 10 months ago (2015-02-04 18:17:51 UTC) #39
commit-bot: I haz the power
5 years, 10 months ago (2015-02-04 18:19:24 UTC) #40
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/266a9e0aa173d6bffbc6484d09c6407c096e6ac3
Cr-Commit-Position: refs/heads/master@{#314586}

Powered by Google App Engine
This is Rietveld 408576698