|
|
Created:
5 years, 4 months ago by Avi (use Gerrit) Modified:
5 years, 4 months ago CC:
mlamouri (slow - plz ping), chromium-reviews, markusheintz_, raymes+watch_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionDo not expire permission bubbles for in-page navigations.
When the IN_PAGE classification was removed in r337562, such navigations were folded into EXISTING_PAGE. The PermissionBubbleManager was checking for EXISTING_PAGE with the understanding that it did not include in-page navigations; restore that understanding.
BUG=516309
TEST=as in bug
Committed: https://crrev.com/4e2c120b7ff86303421ef94a36d0f8de4bc558ea
Cr-Commit-Position: refs/heads/master@{#341554}
Patch Set 1 #
Total comments: 5
Messages
Total messages: 17 (4 generated)
avi@chromium.org changed reviewers: + felt@chromium.org
Adrienne, something for you. BTW, I searched the code, and PermissionBubbleManager is the only code that explicitly listens for EXISTING_PAGE in this way.
+hector and mounir as an FYI since you were both touching this code Thanks Avi, lgtm.
The CQ bit was checked by avi@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1266003004/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1266003004/1
Message was sent while issue was closed.
Committed patchset #1 (id:1)
Message was sent while issue was closed.
Patchset 1 (id:??) landed as https://crrev.com/4e2c120b7ff86303421ef94a36d0f8de4bc558ea Cr-Commit-Position: refs/heads/master@{#341554}
Message was sent while issue was closed.
mlamouri@chromium.org changed reviewers: + mlamouri@chromium.org
Message was sent while issue was closed.
https://codereview.chromium.org/1266003004/diff/1/chrome/browser/ui/website_s... File chrome/browser/ui/website_settings/permission_bubble_manager.cc (right): https://codereview.chromium.org/1266003004/diff/1/chrome/browser/ui/website_s... chrome/browser/ui/website_settings/permission_bubble_manager.cc:277: !details.is_in_page)) { Why not use ::DidNavigateAnyFrame() to merge this and main_frame_has_fully_loaded_ reset?
Message was sent while issue was closed.
https://codereview.chromium.org/1266003004/diff/1/chrome/browser/ui/website_s... File chrome/browser/ui/website_settings/permission_bubble_manager.cc (right): https://codereview.chromium.org/1266003004/diff/1/chrome/browser/ui/website_s... chrome/browser/ui/website_settings/permission_bubble_manager.cc:277: !details.is_in_page)) { On 2015/08/04 11:56:38, Mounir Lamouri wrote: > Why not use ::DidNavigateAnyFrame() to merge this and > main_frame_has_fully_loaded_ reset? Because I don't know this code well, and I was trying to make the smallest change to keep the intent the same. If you know this code better, and think that's a better choice, please do so.
Message was sent while issue was closed.
hcarmona@chromium.org changed reviewers: + hcarmona@chromium.org
Message was sent while issue was closed.
https://codereview.chromium.org/1266003004/diff/1/chrome/browser/ui/website_s... File chrome/browser/ui/website_settings/permission_bubble_manager.cc (right): https://codereview.chromium.org/1266003004/diff/1/chrome/browser/ui/website_s... chrome/browser/ui/website_settings/permission_bubble_manager.cc:277: !details.is_in_page)) { It looks like using GetAsReferrer to compare the request and previous URLs is trying to achieve the same as details.is_in_page. I think it might be best to change this if condition to: if (!details.is_in_page || details.type == content::NAVIGATION_TYPE_SAME_PAGE || details.type == content::NAVIGATION_TYPE_EXISTING_PAGE) Because we want to clear permissions if we navigate to a different URL, explicitly navigate to the same page, or refresh the page.
Message was sent while issue was closed.
https://codereview.chromium.org/1266003004/diff/1/chrome/browser/ui/website_s... File chrome/browser/ui/website_settings/permission_bubble_manager.cc (right): https://codereview.chromium.org/1266003004/diff/1/chrome/browser/ui/website_s... chrome/browser/ui/website_settings/permission_bubble_manager.cc:277: !details.is_in_page)) { On 2015/08/04 23:10:44, Hector Carmona wrote: > It looks like using GetAsReferrer to compare the request and previous > URLs is trying to achieve the same as details.is_in_page. > > I think it might be best to change this if condition to: > > if (!details.is_in_page || > details.type == content::NAVIGATION_TYPE_SAME_PAGE || > details.type == content::NAVIGATION_TYPE_EXISTING_PAGE) > > Because we want to clear permissions if we navigate to a different URL, > explicitly navigate to the same page, or refresh the page. But that's different behavior. The bug calls out going back over an in-page navigation which is EXISTING_PAGE + is_in_page. If you want to argue that the current behavior is incorrect, that's fine with me; I'm no expert. Go make a CL to do it. But my change _restored_ the behavior that this had before my change.
Message was sent while issue was closed.
https://codereview.chromium.org/1266003004/diff/1/chrome/browser/ui/website_s... File chrome/browser/ui/website_settings/permission_bubble_manager.cc (right): https://codereview.chromium.org/1266003004/diff/1/chrome/browser/ui/website_s... chrome/browser/ui/website_settings/permission_bubble_manager.cc:277: !details.is_in_page)) { On 2015/08/05 15:11:48, Avi wrote: > On 2015/08/04 23:10:44, Hector Carmona wrote: > > It looks like using GetAsReferrer to compare the request and previous > > URLs is trying to achieve the same as details.is_in_page. > > > > I think it might be best to change this if condition to: > > > > if (!details.is_in_page || > > details.type == content::NAVIGATION_TYPE_SAME_PAGE || > > details.type == content::NAVIGATION_TYPE_EXISTING_PAGE) > > > > Because we want to clear permissions if we navigate to a different URL, > > explicitly navigate to the same page, or refresh the page. > > But that's different behavior. The bug calls out going back over an in-page > navigation which is EXISTING_PAGE + is_in_page. > > If you want to argue that the current behavior is incorrect, that's fine with > me; I'm no expert. Go make a CL to do it. But my change _restored_ the behavior > that this had before my change. Interesting. I didn't know there were cases where the permission bubbles should survive back/forward navigation, but it does makes sense. I can make a change to get to the correct behavior, but I want to clarify what that is exactly. Are there other cases I'm not aware of? go/when-to-dismiss-permissions
Message was sent while issue was closed.
On 2015/08/05 18:51:04, Hector Carmona wrote: > https://codereview.chromium.org/1266003004/diff/1/chrome/browser/ui/website_s... > File chrome/browser/ui/website_settings/permission_bubble_manager.cc (right): > > https://codereview.chromium.org/1266003004/diff/1/chrome/browser/ui/website_s... > chrome/browser/ui/website_settings/permission_bubble_manager.cc:277: > !details.is_in_page)) { > On 2015/08/05 15:11:48, Avi wrote: > > On 2015/08/04 23:10:44, Hector Carmona wrote: > > > It looks like using GetAsReferrer to compare the request and previous > > > URLs is trying to achieve the same as details.is_in_page. > > > > > > I think it might be best to change this if condition to: > > > > > > if (!details.is_in_page || > > > details.type == content::NAVIGATION_TYPE_SAME_PAGE || > > > details.type == content::NAVIGATION_TYPE_EXISTING_PAGE) > > > > > > Because we want to clear permissions if we navigate to a different URL, > > > explicitly navigate to the same page, or refresh the page. > > > > But that's different behavior. The bug calls out going back over an in-page > > navigation which is EXISTING_PAGE + is_in_page. > > > > If you want to argue that the current behavior is incorrect, that's fine with > > me; I'm no expert. Go make a CL to do it. But my change _restored_ the > behavior > > that this had before my change. > > Interesting. I didn't know there were cases where the permission bubbles > should survive back/forward navigation, but it does makes sense. > > I can make a change to get to the correct behavior, but I want to > clarify what that is exactly. Are there other cases I'm not aware of? > go/when-to-dismiss-permissions I don't know. I'm not a permissions person, I'm a navigation person who broke this little bit of code.
Message was sent while issue was closed.
On 2015/08/05 19:07:12, Avi wrote: > On 2015/08/05 18:51:04, Hector Carmona wrote: > > > https://codereview.chromium.org/1266003004/diff/1/chrome/browser/ui/website_s... > > File chrome/browser/ui/website_settings/permission_bubble_manager.cc (right): > > > > > https://codereview.chromium.org/1266003004/diff/1/chrome/browser/ui/website_s... > > chrome/browser/ui/website_settings/permission_bubble_manager.cc:277: > > !details.is_in_page)) { > > On 2015/08/05 15:11:48, Avi wrote: > > > On 2015/08/04 23:10:44, Hector Carmona wrote: > > > > It looks like using GetAsReferrer to compare the request and previous > > > > URLs is trying to achieve the same as details.is_in_page. > > > > > > > > I think it might be best to change this if condition to: > > > > > > > > if (!details.is_in_page || > > > > details.type == content::NAVIGATION_TYPE_SAME_PAGE || > > > > details.type == content::NAVIGATION_TYPE_EXISTING_PAGE) > > > > > > > > Because we want to clear permissions if we navigate to a different URL, > > > > explicitly navigate to the same page, or refresh the page. > > > > > > But that's different behavior. The bug calls out going back over an in-page > > > navigation which is EXISTING_PAGE + is_in_page. > > > > > > If you want to argue that the current behavior is incorrect, that's fine > with > > > me; I'm no expert. Go make a CL to do it. But my change _restored_ the > > behavior > > > that this had before my change. > > > > Interesting. I didn't know there were cases where the permission bubbles > > should survive back/forward navigation, but it does makes sense. > > > > I can make a change to get to the correct behavior, but I want to > > clarify what that is exactly. Are there other cases I'm not aware of? > > go/when-to-dismiss-permissions > > I don't know. I'm not a permissions person, I'm a navigation person who broke > this little bit of code. BTW, I'm interested in exploring a rewrite of this part of the code with you, as I'm investigating the possibility of removing NavigationType.
Message was sent while issue was closed.
On 2015/08/05 19:31:16, Avi wrote: > On 2015/08/05 19:07:12, Avi wrote: > > On 2015/08/05 18:51:04, Hector Carmona wrote: > > > > > > https://codereview.chromium.org/1266003004/diff/1/chrome/browser/ui/website_s... > > > File chrome/browser/ui/website_settings/permission_bubble_manager.cc > (right): > > > > > > > > > https://codereview.chromium.org/1266003004/diff/1/chrome/browser/ui/website_s... > > > chrome/browser/ui/website_settings/permission_bubble_manager.cc:277: > > > !details.is_in_page)) { > > > On 2015/08/05 15:11:48, Avi wrote: > > > > On 2015/08/04 23:10:44, Hector Carmona wrote: > > > > > It looks like using GetAsReferrer to compare the request and previous > > > > > URLs is trying to achieve the same as details.is_in_page. > > > > > > > > > > I think it might be best to change this if condition to: > > > > > > > > > > if (!details.is_in_page || > > > > > details.type == content::NAVIGATION_TYPE_SAME_PAGE || > > > > > details.type == content::NAVIGATION_TYPE_EXISTING_PAGE) > > > > > > > > > > Because we want to clear permissions if we navigate to a different URL, > > > > > explicitly navigate to the same page, or refresh the page. > > > > > > > > But that's different behavior. The bug calls out going back over an > in-page > > > > navigation which is EXISTING_PAGE + is_in_page. > > > > > > > > If you want to argue that the current behavior is incorrect, that's fine > > with > > > > me; I'm no expert. Go make a CL to do it. But my change _restored_ the > > > behavior > > > > that this had before my change. > > > > > > Interesting. I didn't know there were cases where the permission bubbles > > > should survive back/forward navigation, but it does makes sense. > > > > > > I can make a change to get to the correct behavior, but I want to > > > clarify what that is exactly. Are there other cases I'm not aware of? > > > go/when-to-dismiss-permissions > > > > I don't know. I'm not a permissions person, I'm a navigation person who broke > > this little bit of code. > > BTW, I'm interested in exploring a rewrite of this part of the code with you, as > I'm investigating the possibility of removing NavigationType. That sounds good. We're in the process of refactoring bubbles, so updating this code would be great if we can remove some of the complexity. |