|
|
Chromium Code Reviews|
Created:
3 years, 8 months ago by benwells Modified:
3 years, 8 months ago CC:
chromium-reviews, mlamouri+watch-permissions_chromium.org, mcasas+geolocation_chromium.org, raymes+watch_chromium.org, mlamouri+watch-geolocation_chromium.org, chrome-apps-syd-reviews_chromium.org Target Ref:
refs/heads/master Project:
chromium Visibility:
Public. |
DescriptionDon't show the Location Settings Dialog if the tab isn't interactable.
If the tab for the web_contents that requested location isn't interactable, the Location Settings Dialog shouldn't be shown. This could happen if the user changed tabs, is in the tab switcher, or if Chrome isn't active.
BUG=710255
Review-Url: https://codereview.chromium.org/2817873002
Cr-Commit-Position: refs/heads/master@{#465795}
Committed: https://chromium.googlesource.com/chromium/src/+/b8a8a089caa1188776c83e4344df494d6f30b969
Patch Set 1 #Patch Set 2 : Fix tests #
Total comments: 2
Patch Set 3 : Rebase #Patch Set 4 : Use IsUserInteractable #Patch Set 5 : Tests again #Messages
Total messages: 32 (22 generated)
The CQ bit was checked by benwells@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...)
The CQ bit was checked by benwells@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
benwells@chromium.org changed reviewers: + msramek@chromium.org, tedchoc@chromium.org
+msramek for privacy eyes +tedchoc for android eyes
LGTM, thanks for the fix!
lgtm w/ long rambling thoughts https://codereview.chromium.org/2817873002/diff/20001/chrome/browser/geolocat... File chrome/browser/geolocation/geolocation_permission_context_android.cc (right): https://codereview.chromium.org/2817873002/diff/20001/chrome/browser/geolocat... chrome/browser/geolocation/geolocation_permission_context_android.cc:246: if (tab_model && tab_model->GetActiveWebContents() != web_contents) { I wonder if this should be !tab_model || Though that might break things if we were ever to enable location requesting in panels like contextual search where it isn't associated with a model. Keep it as is, I wonder if we should add something like !web_contents->IsHidden() or something to capture other cases? We also added TabAndroid::IsUserInteractable to handle cases where you are in the tab switcher where we wouldn't necessarily want to popup stuff either. We likely could use that call instead of the tab model if we wanted to be a bit more restrictive.
https://codereview.chromium.org/2817873002/diff/20001/chrome/browser/geolocat... File chrome/browser/geolocation/geolocation_permission_context_android.cc (right): https://codereview.chromium.org/2817873002/diff/20001/chrome/browser/geolocat... chrome/browser/geolocation/geolocation_permission_context_android.cc:246: if (tab_model && tab_model->GetActiveWebContents() != web_contents) { On 2017/04/13 15:47:08, Ted C wrote: > I wonder if this should be !tab_model || It was like this originally, but it broke some tests that have a null tab model. > > Though that might break things if we were ever to enable location requesting in > panels like contextual search where it isn't associated with a model. > > Keep it as is, I wonder if we should add something like > !web_contents->IsHidden() or something to capture other cases? > > We also added TabAndroid::IsUserInteractable to handle cases where you are in > the tab switcher where we wouldn't necessarily want to popup stuff either. We > likely could use that call instead of the tab model if we wanted to be a bit > more restrictive. I think that's a good idea. I'll poke with that next week. Another case to handle is that Chrome isn't the active application ... I was going to handle that on the Java side but maybe IsUserInteractable or / or IsHidden can do it instead.
On 2017/04/14 00:13:53, benwells wrote: > https://codereview.chromium.org/2817873002/diff/20001/chrome/browser/geolocat... > File chrome/browser/geolocation/geolocation_permission_context_android.cc > (right): > > https://codereview.chromium.org/2817873002/diff/20001/chrome/browser/geolocat... > chrome/browser/geolocation/geolocation_permission_context_android.cc:246: if > (tab_model && tab_model->GetActiveWebContents() != web_contents) { > On 2017/04/13 15:47:08, Ted C wrote: > > I wonder if this should be !tab_model || > > It was like this originally, but it broke some tests that have a null tab model. > > > > > Though that might break things if we were ever to enable location requesting > in > > panels like contextual search where it isn't associated with a model. > > > > Keep it as is, I wonder if we should add something like > > !web_contents->IsHidden() or something to capture other cases? > > > > We also added TabAndroid::IsUserInteractable to handle cases where you are in > > the tab switcher where we wouldn't necessarily want to popup stuff either. We > > likely could use that call instead of the tab model if we wanted to be a bit > > more restrictive. > > I think that's a good idea. I'll poke with that next week. Another case to > handle is that Chrome isn't the active application ... I was going to handle > that on the Java side but maybe IsUserInteractable or / or IsHidden can do it > instead. I "think" IsUserInteractable handles that as we call Tab#hide in Tab#onActivityHidden. It probably would return true if you're in multi-window but interacting with another application. But I think it still gets you much closer to it.
On 2017/04/14 00:13:53, benwells wrote: > https://codereview.chromium.org/2817873002/diff/20001/chrome/browser/geolocat... > File chrome/browser/geolocation/geolocation_permission_context_android.cc > (right): > > https://codereview.chromium.org/2817873002/diff/20001/chrome/browser/geolocat... > chrome/browser/geolocation/geolocation_permission_context_android.cc:246: if > (tab_model && tab_model->GetActiveWebContents() != web_contents) { > On 2017/04/13 15:47:08, Ted C wrote: > > I wonder if this should be !tab_model || > > It was like this originally, but it broke some tests that have a null tab model. > > > > > Though that might break things if we were ever to enable location requesting > in > > panels like contextual search where it isn't associated with a model. > > > > Keep it as is, I wonder if we should add something like > > !web_contents->IsHidden() or something to capture other cases? > > > > We also added TabAndroid::IsUserInteractable to handle cases where you are in > > the tab switcher where we wouldn't necessarily want to popup stuff either. We > > likely could use that call instead of the tab model if we wanted to be a bit > > more restrictive. > > I think that's a good idea. I'll poke with that next week. Another case to > handle is that Chrome isn't the active application ... I was going to handle > that on the Java side but maybe IsUserInteractable or / or IsHidden can do it > instead. I "think" IsUserInteractable handles that as we call Tab#hide in Tab#onActivityHidden. It probably would return true if you're in multi-window but interacting with another application. But I think it still gets you much closer to it.
The CQ bit was checked by benwells@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Don't show the Location Settings Dialog if the current tab has changed. If the active tab isn't for the web contents that requested location, don't show the Location Settings Dialog. BUG=710255 ========== to ========== Don't show the Location Settings Dialog if the tab isn't interactable. If the tab for the web_contents that requested location isn't interactable, the Location Settings Dialog shouldn't be shown. This could happen if the user changed tabs, is in the tab switcher, or if Chrome isn't active. BUG=710255 ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...)
The CQ bit was checked by benwells@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Ted - this is using IsUserInteractable. Care to take another look?
lgtm
The CQ bit was checked by benwells@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from msramek@chromium.org Link to the patchset: https://codereview.chromium.org/2817873002/#ps80001 (title: "Tests again")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 80001, "attempt_start_ts": 1492642043250780,
"parent_rev": "f628d6b4367d88b92e0bcf56886450e26ed58d55", "commit_rev":
"b8a8a089caa1188776c83e4344df494d6f30b969"}
Message was sent while issue was closed.
Description was changed from ========== Don't show the Location Settings Dialog if the tab isn't interactable. If the tab for the web_contents that requested location isn't interactable, the Location Settings Dialog shouldn't be shown. This could happen if the user changed tabs, is in the tab switcher, or if Chrome isn't active. BUG=710255 ========== to ========== Don't show the Location Settings Dialog if the tab isn't interactable. If the tab for the web_contents that requested location isn't interactable, the Location Settings Dialog shouldn't be shown. This could happen if the user changed tabs, is in the tab switcher, or if Chrome isn't active. BUG=710255 Review-Url: https://codereview.chromium.org/2817873002 Cr-Commit-Position: refs/heads/master@{#465795} Committed: https://chromium.googlesource.com/chromium/src/+/b8a8a089caa1188776c83e4344df... ==========
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as https://chromium.googlesource.com/chromium/src/+/b8a8a089caa1188776c83e4344df... |
