Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java |
| index e113bc1c371dd20d294ae42d255cdb6aea2a1ef6..6c1564bd74c1dd1a28ea9a2e95b759cbdf2ca5f2 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java |
| @@ -810,8 +810,6 @@ abstract class ContextualSearchPanelBase implements ContextualSearchPromoHost { |
| * @param reason The reason for a change in the panel's state. |
| */ |
| public void setPanelState(PanelState state, StateChangeReason reason) { |
| - mPanelState = state; |
| - |
| if (state == PanelState.CLOSED) { |
| mIsShowing = false; |
| onClosed(reason); |
| @@ -819,6 +817,12 @@ abstract class ContextualSearchPanelBase implements ContextualSearchPromoHost { |
| || (state == PanelState.MAXIMIZED && !isFullscreenSizePanel())) { |
| showPromoViewAtYPosition(getPromoYPx()); |
| } |
| + |
| + // We should only set the state at the end of this method, in oder to make sure the |
|
Donn Denman
2015/10/27 19:18:51
nit: typo at end, change "the" to "that".
pedro (no code reviews)
2015/10/29 22:05:28
Done.
|
| + // all callbacks will be fired before changing the state of the Panel. This prevents |
| + // some flakiness on tests since they rely on changes of state to determine when a |
| + // particular action has been completed. |
| + mPanelState = state; |
| } |
| /** |