|
|
Created:
5 years, 3 months ago by Yusuf Modified:
5 years, 3 months ago Reviewers:
David Trainor- moved to gerrit CC:
chromium-reviews Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionFix crash on J,K while swiping on custom tabs title
We use LayoutManagerChrome on Tabbed mode and override all related
swipe related code, but the parent class LayoutMangerDocument has
document mode specific behavior which requires L only APIs. Until
custom tabs launched, it wasn't possible to reach this codepath since
no J,K builds had an activity launching with LayoutManagerDocument.
This guards the call with a no op if the device is not document eligible.
BUG=525153
Committed: https://crrev.com/a1051b84638e236bddcb2b5ae195278d292cc9bc
Cr-Commit-Position: refs/heads/master@{#346783}
Patch Set 1 #
Total comments: 2
Patch Set 2 : Updated isSwipeEnabled #
Total comments: 3
Depends on Patchset: Messages
Total messages: 17 (5 generated)
yusufo@chromium.org changed reviewers: + dtrainor@chromium.org
The CQ bit was checked by yusufo@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1313043003/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1313043003/1
https://codereview.chromium.org/1313043003/diff/1/chrome/android/java/src/org... File chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerDocument.java (right): https://codereview.chromium.org/1313043003/diff/1/chrome/android/java/src/org... chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerDocument.java:430: if (!FeatureUtilities.isDocumentModeEligible(context)) return; This should probably go into isSwipeEnabled right? It looks like that's *trying* to do what this is doing (probably fixes normal document mode, but not custom tabs). Also, can we use mHost.getContext()?
https://codereview.chromium.org/1313043003/diff/1/chrome/android/java/src/org... File chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerDocument.java (right): https://codereview.chromium.org/1313043003/diff/1/chrome/android/java/src/org... chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerDocument.java:430: if (!FeatureUtilities.isDocumentModeEligible(context)) return; On 2015/09/01 21:56:38, David Trainor wrote: > This should probably go into isSwipeEnabled right? It looks like that's > *trying* to do what this is doing (probably fixes normal document mode, but not > custom tabs). > > Also, can we use mHost.getContext()? Done.
The CQ bit was checked by yusufo@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1313043003/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1313043003/20001
https://codereview.chromium.org/1313043003/diff/20001/chrome/android/java/src... File chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerDocument.java (right): https://codereview.chromium.org/1313043003/diff/20001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerDocument.java:448: || !FeatureUtilities.isDocumentModeEligible(mHost.getContext()) Now that I think about it, I think this is supposed to work with document mode right? We use model.setIndex() to force the activity swap. I'm actually surprised this is enabled though. I think the issue is you're in "tabbed chrome" but in a "custom tab" right?
https://codereview.chromium.org/1313043003/diff/20001/chrome/android/java/src... File chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerDocument.java (right): https://codereview.chromium.org/1313043003/diff/20001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerDocument.java:448: || !FeatureUtilities.isDocumentModeEligible(mHost.getContext()) On 2015/09/01 22:23:50, David Trainor wrote: > Now that I think about it, I think this is supposed to work with document mode > right? We use model.setIndex() to force the activity swap. I'm actually > surprised this is enabled though. I think the issue is you're in "tabbed > chrome" but in a "custom tab" right? Yes, we are in tabbed mode since it is J or K. It is not "really" enabled. The base class is LayoutManagerDocument and all related impl assumes since you are using this class and not overriding anything running L APIs is OK which is imo the main problem here. We have @TargetAPI(Lollipop) above but no formal code that blocks the use of that API. This line fixes that. CustomTabActivity by using the simplest, parent LayoutManager starting calling that API on J and K devices.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm https://codereview.chromium.org/1313043003/diff/20001/chrome/android/java/src... File chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerDocument.java (right): https://codereview.chromium.org/1313043003/diff/20001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerDocument.java:448: || !FeatureUtilities.isDocumentModeEligible(mHost.getContext()) On 2015/09/01 22:29:42, Yusuf wrote: > On 2015/09/01 22:23:50, David Trainor wrote: > > Now that I think about it, I think this is supposed to work with document mode > > right? We use model.setIndex() to force the activity swap. I'm actually > > surprised this is enabled though. I think the issue is you're in "tabbed > > chrome" but in a "custom tab" right? > > Yes, we are in tabbed mode since it is J or K. It is not "really" enabled. The > base class is LayoutManagerDocument and all related impl assumes since you are > using this class and not overriding anything running L APIs is OK which is imo > the main problem here. > > We have @TargetAPI(Lollipop) above but no formal code that blocks the use of > that API. This line fixes that. CustomTabActivity by using the simplest, parent > LayoutManager starting calling that API on J and K devices. Ok that works for me and makes sense! :)
The CQ bit was checked by yusufo@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1313043003/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1313043003/20001
Message was sent while issue was closed.
Committed patchset #2 (id:20001)
Message was sent while issue was closed.
Patchset 2 (id:??) landed as https://crrev.com/a1051b84638e236bddcb2b5ae195278d292cc9bc Cr-Commit-Position: refs/heads/master@{#346783} |