|
|
Chromium Code Reviews
DescriptionCustom Tabs: Preserve the offline bolt icon when showing an offline page.
The security level gets updated after the custom tab is navigated to a
new page, and as a result the security icon is removed, because offline
pages are shown with a connection security level of NONE. However, the
bolt icon is another state of the connection security level, so we need
to update the bolt if we don't think that there is any security.
BUG=653934
Committed: https://crrev.com/b0d23feb21be94dc0fce54f982e15b8262d49736
Cr-Commit-Position: refs/heads/master@{#425697}
Patch Set 1 #
Total comments: 1
Patch Set 2 : Address bug with security state transitions to NONE without involving offline page. #Patch Set 3 : git cl try #
Total comments: 1
Patch Set 4 : Consolidate security button code. #
Total comments: 5
Patch Set 5 : remove redundant line. #Patch Set 6 : Hide security button if no drawable is available. #Messages
Total messages: 37 (22 generated)
The CQ bit was checked by dewittj@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...
dewittj@chromium.org changed reviewers: + fgorski@chromium.org, tedchoc@chromium.org
PTAL, thanks.
lgtm
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
tedchoc@chromium.org changed reviewers: + yusufo@chromium.org
+yusufo since this is CCT related https://codereview.chromium.org/2420663002/diff/1/chrome/android/java/src/org... File chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java (right): https://codereview.chromium.org/2420663002/diff/1/chrome/android/java/src/org... chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java:501: showOfflineBoltIfNecessary(); What happens if you navigate to an HTTPS page and then to an HTTP page (w/o any offline pages involved)? Since mShowsOfflinePage is already false in showOfflineBoltIfNecessary, it seems like we wouldn't hide the lock icon.
The CQ bit was checked by dewittj@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...
Good catch. I'm not sure a page would be downgraded like you suggest normally without other signals saying it's a new page, but it's worth defending against. I changed showOfflineBoltIfNecessary to report whether it made any changes, but it feels ugly. Since I am not super familiar with all the possible state changes it seemed the safest way to make this change. Suggestions accepted on how to refactor this reliably.
On 2016/10/13 20:57:56, dewittj wrote: > Good catch. I'm not sure a page would be downgraded like you suggest normally > without other signals saying it's a new page, but it's worth defending against. > > I changed showOfflineBoltIfNecessary to report whether it made any changes, but > it feels ugly. Since I am not super familiar with all the possible state > changes it seemed the safest way to make this change. Suggestions accepted on > how to refactor this reliably. lgtm
lgtm https://codereview.chromium.org/2420663002/diff/40001/chrome/android/java/src... File chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java (right): https://codereview.chromium.org/2420663002/diff/40001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java:501: if (!showOfflineBoltIfNecessary()) { would probably fit one line?
Patchset #4 (id:60001) has been deleted
sorry for all the churn, but there was a bug in the last patchset, so I consolidated all the icon code. I think it's much cleaner now - and less prone to bugs. What do you think?
lgtm https://codereview.chromium.org/2420663002/diff/80001/chrome/android/java/src... File chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java (right): https://codereview.chromium.org/2420663002/diff/80001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java:514: mSecurityButton.setImageDrawable(null); To make this more correct, I would do this: showSecurityButton = false; https://codereview.chromium.org/2420663002/diff/80001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java:522: mAnimDelegate.showSecurityButton(); you don't need this line anymore right?
https://codereview.chromium.org/2420663002/diff/80001/chrome/android/java/src... File chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java (right): https://codereview.chromium.org/2420663002/diff/80001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java:514: mSecurityButton.setImageDrawable(null); On 2016/10/14 20:37:59, Ted C wrote: > To make this more correct, I would do this: > > showSecurityButton = false; That will have slightly different behavior than before this patch, since it would explicitly have called |showSecurityButton|, and after that change it will call |hideSecurityButton|. I can do that, but am not sure of the UI implications. Is that what you meant? https://codereview.chromium.org/2420663002/diff/80001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java:522: mAnimDelegate.showSecurityButton(); On 2016/10/14 20:37:59, Ted C wrote: > you don't need this line anymore right? Done.
The CQ bit was checked by dewittj@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/2420663002/diff/80001/chrome/android/java/src... File chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java (right): https://codereview.chromium.org/2420663002/diff/80001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java:514: mSecurityButton.setImageDrawable(null); On 2016/10/14 20:49:30, dewittj wrote: > On 2016/10/14 20:37:59, Ted C wrote: > > To make this more correct, I would do this: > > > > showSecurityButton = false; > > That will have slightly different behavior than before this patch, since it > would explicitly have called |showSecurityButton|, and after that change it will > call |hideSecurityButton|. I can do that, but am not sure of the UI > implications. Is that what you meant? Yeah, I'm suggesting a change in behavior. It definitely seems wrong as it was.
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 dewittj@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...
On 2016/10/14 21:08:03, Ted C wrote: > https://codereview.chromium.org/2420663002/diff/80001/chrome/android/java/src... > File > chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java > (right): > > https://codereview.chromium.org/2420663002/diff/80001/chrome/android/java/src... > chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java:514: > mSecurityButton.setImageDrawable(null); > On 2016/10/14 20:49:30, dewittj wrote: > > On 2016/10/14 20:37:59, Ted C wrote: > > > To make this more correct, I would do this: > > > > > > showSecurityButton = false; > > > > That will have slightly different behavior than before this patch, since it > > would explicitly have called |showSecurityButton|, and after that change it > will > > call |hideSecurityButton|. I can do that, but am not sure of the UI > > implications. Is that what you meant? > > Yeah, I'm suggesting a change in behavior. It definitely seems wrong as it was. Done. I removed setting the drawable to |null| since it seemed better to gradually animate it out than to set drawable to null instantly and then animate it out.
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 dewittj@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from fgorski@chromium.org, yusufo@chromium.org, tedchoc@chromium.org Link to the patchset: https://codereview.chromium.org/2420663002/#ps120001 (title: "Hide security button if no drawable is available.")
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 dewittj@chromium.org
The CQ bit was checked by dewittj@chromium.org
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.
Committed patchset #6 (id:120001)
Message was sent while issue was closed.
Description was changed from ========== Custom Tabs: Preserve the offline bolt icon when showing an offline page. The security level gets updated after the custom tab is navigated to a new page, and as a result the security icon is removed, because offline pages are shown with a connection security level of NONE. However, the bolt icon is another state of the connection security level, so we need to update the bolt if we don't think that there is any security. BUG=653934 ========== to ========== Custom Tabs: Preserve the offline bolt icon when showing an offline page. The security level gets updated after the custom tab is navigated to a new page, and as a result the security icon is removed, because offline pages are shown with a connection security level of NONE. However, the bolt icon is another state of the connection security level, so we need to update the bolt if we don't think that there is any security. BUG=653934 Committed: https://crrev.com/b0d23feb21be94dc0fce54f982e15b8262d49736 Cr-Commit-Position: refs/heads/master@{#425697} ==========
Message was sent while issue was closed.
Patchset 6 (id:??) landed as https://crrev.com/b0d23feb21be94dc0fce54f982e15b8262d49736 Cr-Commit-Position: refs/heads/master@{#425697} |
