Fix a bug in TabGridDialog initial visibility setup
http://crrev.com/c/2242222 sets the dialog visibility into false in TabGridDialog constructor as a default value for this field. Setting this in PropertyModel will emit a signal to hide the dialog, but the signal should be no-op as the dialog is not showing. Otherwise this will break a assumption in ScrimView and crash. http://crrev.com/c/2242222 enforces this is no-op by ignoring the signal when mScrimPropertyModel is not setup. The assumption here is that the dummy signal will always arrive earlier than the mScrimPropertyModel setup, which happens when dialog is first shown. However, this assumption no longer holds for StartSurface, because for StartSurface, the initialization of TabGridDialog (which is controlled by the initialization of TabSwitcher) can happen later than the first show of TabGridDialog. Such a flow can be: Step1) Open dialog from strip and dismiss. (This is when mScrimPropertyModel sets up.) Step2) Click the tab switcher button to enter tab switcher. (This is when the dummy hide dialog signal is sent out.) This CL fixes this issue by switching to a more stable way to filter out dummy signal: whether the dialog is showing. This way we make sure that the signals that should be no-op on dialog side are in fact no-op. Bug: 1096358 Change-Id: I6847b3d2545238933a42a6b610c07e4a9623d066 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2362970 Commit-Queue: Yue Zhang <yuezhanggg@chromium.org> Reviewed-by:Wei-Yin Chen (陳威尹) <wychen@chromium.org> Cr-Commit-Position: refs/heads/master@{#800677}
Showing
Please register or sign in to comment