Commit 637baf71 authored by Yue Zhang's avatar Yue Zhang Committed by Commit Bot

Fix a Context misuage in TabGridDialogMenuCoordinator

For devices with Api < 21, when we do v.getContext() where v is a
AppCompatImageView, we get a wrapped TintContextWrapper instead of a
normal Context. Casting TintContextWrapper to Activity will cause
crash. This CL fixes this misusage in TabGridDialogMenuCoordinator.

Bug: 1013555
Change-Id: I7e48923c319393def4a3f2dc130bd681347c35b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1850591
Commit-Queue: Yue Zhang <yuezhanggg@chromium.org>
Reviewed-by: default avatarWei-Yin Chen (陳威尹) <wychen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705334}
parent 3526bc38
...@@ -99,7 +99,7 @@ public class TabGridDialogMenuCoordinator { ...@@ -99,7 +99,7 @@ public class TabGridDialogMenuCoordinator {
mMenuWindow.dismiss(); mMenuWindow.dismiss();
}); });
View decorView = ((Activity) mContext).getWindow().getDecorView(); View decorView = ((Activity) contentView.getContext()).getWindow().getDecorView();
ViewRectProvider rectProvider = new ViewRectProvider(anchorView); ViewRectProvider rectProvider = new ViewRectProvider(anchorView);
Rect rect = new Rect(); Rect rect = new Rect();
decorView.getWindowVisibleDisplayFrame(rect); decorView.getWindowVisibleDisplayFrame(rect);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment