|
|
Chromium Code Reviews|
Created:
4 years, 3 months ago by lshang Modified:
4 years, 2 months ago CC:
chromium-reviews, mlamouri+watch-permissions_chromium.org, feature-media-reviews_chromium.org, mcasas+watch+vc_chromium.org, miu+watch_chromium.org, chrome-apps-syd-reviews_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionUse vector of PermissionRequest instead of ContentSettingsTypes for GroupedPermissionInfoBarDelegate
Plumb in permission requests in grouped permission infobar delegate, instead of
just content setting types.
BUG=606138
Committed: https://crrev.com/ada00c1966ad0607f0fb61c970d9d92713679fb7
Cr-Commit-Position: refs/heads/master@{#425616}
Patch Set 1 #Patch Set 2 #Patch Set 3 : Merge branch 'undo_media_infobar_delegate' into use_array_of_PR_for_GPID #
Total comments: 7
Patch Set 4 : address review comments #Patch Set 5 : address review comments #
Total comments: 2
Patch Set 6 : minor change in comment #Patch Set 7 : revert back to patchset 6 version #Patch Set 8 : fix patch failure #
Messages
Total messages: 63 (53 generated)
The CQ bit was checked by lshang@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: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_...)
The CQ bit was checked by lshang@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 checked by lshang@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 ========== Use list of PermissionRequest instead of ContentSettingsTypes for GroupedPermissionInfoBarDelegate use array of permission requests BUG= ========== to ========== Use vector of PermissionRequest instead of ContentSettingsTypes for GroupedPermissionInfoBarDelegate This will allow GroupedPermissionInfoBarDelegate(GPIBD) to manager other permission types, and allow MediaStreamInfoBarDelegateAndroid to be merged into GPIBD. BUG=606138 ==========
Patchset #2 (id:20001) has been deleted
lshang@chromium.org changed reviewers: + tsergeant@chromium.org
PTAL thanks!
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lshang@chromium.org changed reviewers: + raymes@chromium.org
The CQ bit was checked by lshang@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.
Description was changed from ========== Use vector of PermissionRequest instead of ContentSettingsTypes for GroupedPermissionInfoBarDelegate This will allow GroupedPermissionInfoBarDelegate(GPIBD) to manager other permission types, and allow MediaStreamInfoBarDelegateAndroid to be merged into GPIBD. BUG=606138 ========== to ========== Use vector of PermissionRequest instead of ContentSettingsTypes for GroupedPermissionInfoBarDelegate Plumb in permission requests in grouped permission infobar delegate, instead of just content setting types. BUG=606138 ==========
The CQ bit was checked by lshang@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.
My comments expand the scope of this CL a bit, sorry! They were things that probably needed to happen eventually anyway, so hopefully it won't be too much trouble to do them now. https://codereview.chromium.org/2339863002/diff/60001/chrome/browser/permissi... File chrome/browser/permissions/grouped_permission_infobar_delegate.cc (right): https://codereview.chromium.org/2339863002/diff/60001/chrome/browser/permissi... chrome/browser/permissions/grouped_permission_infobar_delegate.cc:5: #include "chrome/browser/media/webrtc/media_stream_devices_controller.h" Is this include necessary? https://codereview.chromium.org/2339863002/diff/60001/chrome/browser/permissi... chrome/browser/permissions/grouped_permission_infobar_delegate.cc:16: ContentSettingsType PermissionRequestTypeToContentType( I think it would be good to avoid adding this conversion method if possible. It won't work for media, and PermissionRequestType is currently only used for UMA. The easiest way would be to add a new method to PermissionRequest like PermissionRequest::GetContentSettingsTypes() that returns a vector of the content settings types for by that request. You can then write an implementation for PermissionRequestImpl and MediaStreamDevicesController, which are the only interesting cases. Annoyingly, PermissionRequestImpl currently only has PermissionTypes, not ContentSettingsTypes. I think it would be fine to write a conversion method in there temporarily. Longer term, we might be able to convert the Android OS permissions system to use PermissionTypes instead of ContentSettingsTypes. https://codereview.chromium.org/2339863002/diff/60001/chrome/browser/permissi... chrome/browser/permissions/grouped_permission_infobar_delegate.cc:92: return PermissionRequestTypeToContentType( The way that this method was written doesn't necessarily work once we have PermissionRequests, since a single PermissionRequest can have multiple content settings types (media will do this). PermissionInfoBarDelegate now has a content_settings() method which returns the full vector of content settings requested by an infobar. Can we override that method and use it instead? This method is only called from one place, https://cs.chromium.org/chromium/src/chrome/browser/ui/android/infobars/group...
The CQ bit was checked by lshang@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...
https://codereview.chromium.org/2339863002/diff/60001/chrome/browser/permissi... File chrome/browser/permissions/grouped_permission_infobar_delegate.cc (right): https://codereview.chromium.org/2339863002/diff/60001/chrome/browser/permissi... chrome/browser/permissions/grouped_permission_infobar_delegate.cc:5: #include "chrome/browser/media/webrtc/media_stream_devices_controller.h" On 2016/09/22 06:53:56, tsergeant wrote: > Is this include necessary? Removed. https://codereview.chromium.org/2339863002/diff/60001/chrome/browser/permissi... chrome/browser/permissions/grouped_permission_infobar_delegate.cc:16: ContentSettingsType PermissionRequestTypeToContentType( On 2016/09/22 06:53:56, tsergeant wrote: > I think it would be good to avoid adding this conversion method if possible. It > won't work for media, and PermissionRequestType is currently only used for UMA. > > The easiest way would be to add a new method to PermissionRequest like > > PermissionRequest::GetContentSettingsTypes() > > that returns a vector of the content settings types for by that request. > > You can then write an implementation for PermissionRequestImpl and > MediaStreamDevicesController, which are the only interesting cases. > > Annoyingly, PermissionRequestImpl currently only has PermissionTypes, not > ContentSettingsTypes. I think it would be fine to write a conversion method in > there temporarily. Longer term, we might be able to convert the Android OS > permissions system to use PermissionTypes instead of ContentSettingsTypes. I moved this conversion to PermissionRequest, but haven't override it in media_stream_devices_controller, since I think now is not a proper time to add support of media in grouped permission infobar delegate. See as below. https://codereview.chromium.org/2339863002/diff/60001/chrome/browser/permissi... chrome/browser/permissions/grouped_permission_infobar_delegate.cc:92: return PermissionRequestTypeToContentType( On 2016/09/22 06:53:56, tsergeant wrote: > The way that this method was written doesn't necessarily work once we have > PermissionRequests, since a single PermissionRequest can have multiple content > settings types (media will do this). > > PermissionInfoBarDelegate now has a content_settings() method which returns the > full vector of content settings requested by an infobar. > > Can we override that method and use it instead? This method is only called from > one place, > https://cs.chromium.org/chromium/src/chrome/browser/ui/android/infobars/group... > I think this CL is not ready for adding support for medias in grouped permission infobar delegate, as we discussed, since if a request can have multiple content settings types, we need to figure out what |index/position| means in getters and ToggleAccept(), which might not be consistent.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm with a comment comment. https://codereview.chromium.org/2339863002/diff/60001/chrome/browser/permissi... File chrome/browser/permissions/grouped_permission_infobar_delegate.cc (right): https://codereview.chromium.org/2339863002/diff/60001/chrome/browser/permissi... chrome/browser/permissions/grouped_permission_infobar_delegate.cc:92: return PermissionRequestTypeToContentType( On 2016/09/27 07:21:52, lshang wrote: > On 2016/09/22 06:53:56, tsergeant wrote: > > The way that this method was written doesn't necessarily work once we have > > PermissionRequests, since a single PermissionRequest can have multiple content > > settings types (media will do this). > > > > PermissionInfoBarDelegate now has a content_settings() method which returns > the > > full vector of content settings requested by an infobar. > > > > Can we override that method and use it instead? This method is only called > from > > one place, > > > https://cs.chromium.org/chromium/src/chrome/browser/ui/android/infobars/group... > > > > I think this CL is not ready for adding support for medias in grouped permission > infobar delegate, as we discussed, since if a request can have multiple content > settings types, we need to figure out what |index/position| means in getters and > ToggleAccept(), which might not be consistent. Yeah, you're right -- there are complications in the Android layer to do with using multiple content settings types per request. This seems fine for now. https://codereview.chromium.org/2339863002/diff/100001/chrome/browser/permiss... File chrome/browser/permissions/permission_request.h (right): https://codereview.chromium.org/2339863002/diff/100001/chrome/browser/permiss... chrome/browser/permissions/permission_request.h:112: // Used for grouped permission infobar. Can you be more specific in this comment? "Used on Android to determine what Android OS permissions are needed for this permission request"
The CQ bit was checked by lshang@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...
Thanks! raymes@, could you PTAL? https://codereview.chromium.org/2339863002/diff/100001/chrome/browser/permiss... File chrome/browser/permissions/permission_request.h (right): https://codereview.chromium.org/2339863002/diff/100001/chrome/browser/permiss... chrome/browser/permissions/permission_request.h:112: // Used for grouped permission infobar. On 2016/09/28 00:01:07, tsergeant wrote: > Can you be more specific in this comment? > > "Used on Android to determine what Android OS permissions are needed for this > permission request" Done with this comment comment XD
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by lshang@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 checked by lshang@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...
Patchset #8 (id:160001) has been deleted
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
raymes@: depending on https://codereview.chromium.org/2415863002/, could you take a look at this CL again? thanks!
As discussed patchset 6 lgtm. It's unfortunate to expose the ContentSettingsType but we really need to unify on a single permission type in the code.
Patchset #7 (id:140001) has been deleted
Patchset #7 (id:180001) has been deleted
Patchset #7 (id:200001) has been deleted
The CQ bit was checked by lshang@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: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
The CQ bit was checked by lshang@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.
The CQ bit was checked by lshang@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from tsergeant@chromium.org, raymes@chromium.org Link to the patchset: https://codereview.chromium.org/2339863002/#ps240001 (title: "fix patch failure")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== Use vector of PermissionRequest instead of ContentSettingsTypes for GroupedPermissionInfoBarDelegate Plumb in permission requests in grouped permission infobar delegate, instead of just content setting types. BUG=606138 ========== to ========== Use vector of PermissionRequest instead of ContentSettingsTypes for GroupedPermissionInfoBarDelegate Plumb in permission requests in grouped permission infobar delegate, instead of just content setting types. BUG=606138 ==========
Message was sent while issue was closed.
Committed patchset #8 (id:240001)
Message was sent while issue was closed.
Description was changed from ========== Use vector of PermissionRequest instead of ContentSettingsTypes for GroupedPermissionInfoBarDelegate Plumb in permission requests in grouped permission infobar delegate, instead of just content setting types. BUG=606138 ========== to ========== Use vector of PermissionRequest instead of ContentSettingsTypes for GroupedPermissionInfoBarDelegate Plumb in permission requests in grouped permission infobar delegate, instead of just content setting types. BUG=606138 Committed: https://crrev.com/ada00c1966ad0607f0fb61c970d9d92713679fb7 Cr-Commit-Position: refs/heads/master@{#425616} ==========
Message was sent while issue was closed.
Patchset 8 (id:??) landed as https://crrev.com/ada00c1966ad0607f0fb61c970d9d92713679fb7 Cr-Commit-Position: refs/heads/master@{#425616} |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
