OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.widget.bottomsheet; | 5 package org.chromium.chrome.browser.widget.bottomsheet; |
6 | 6 |
7 import android.animation.Animator; | 7 import android.animation.Animator; |
8 import android.animation.AnimatorListenerAdapter; | 8 import android.animation.AnimatorListenerAdapter; |
9 import android.animation.AnimatorSet; | 9 import android.animation.AnimatorSet; |
10 import android.animation.ObjectAnimator; | 10 import android.animation.ObjectAnimator; |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 mTabModelSelector.addObserver(new EmptyTabModelSelectorObserver() { | 501 mTabModelSelector.addObserver(new EmptyTabModelSelectorObserver() { |
502 @Override | 502 @Override |
503 public void onTabStateInitialized() { | 503 public void onTabStateInitialized() { |
504 if (mHasRootLayoutOccurred) showHelpBubbleIfNecessary(); | 504 if (mHasRootLayoutOccurred) showHelpBubbleIfNecessary(); |
505 mTabModelSelector.removeObserver(this); | 505 mTabModelSelector.removeObserver(this); |
506 } | 506 } |
507 }); | 507 }); |
508 } | 508 } |
509 | 509 |
510 mNtpController.setTabModelSelector(tabModelSelector); | 510 mNtpController.setTabModelSelector(tabModelSelector); |
| 511 |
| 512 mTabModelSelector.addObserver(new EmptyTabModelSelectorObserver() { |
| 513 @Override |
| 514 public void onTabModelSelected(TabModel newModel, TabModel oldModel)
{ |
| 515 setSheetState(SHEET_STATE_PEEK, true); |
| 516 } |
| 517 }); |
511 } | 518 } |
512 | 519 |
513 /** | 520 /** |
514 * @param layoutManager The {@link LayoutManagerChrome} used to show and hid
e overview mode. | 521 * @param layoutManager The {@link LayoutManagerChrome} used to show and hid
e overview mode. |
515 */ | 522 */ |
516 public void setLayoutManagerChrome(LayoutManagerChrome layoutManager) { | 523 public void setLayoutManagerChrome(LayoutManagerChrome layoutManager) { |
517 mNtpController.setLayoutManagerChrome(layoutManager); | 524 mNtpController.setLayoutManagerChrome(layoutManager); |
518 } | 525 } |
519 | 526 |
520 /** | 527 /** |
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1258 } | 1265 } |
1259 | 1266 |
1260 /** Ends all animations. */ | 1267 /** Ends all animations. */ |
1261 @VisibleForTesting | 1268 @VisibleForTesting |
1262 public void endAnimationsForTests() { | 1269 public void endAnimationsForTests() { |
1263 if (mSettleAnimator != null) mSettleAnimator.end(); | 1270 if (mSettleAnimator != null) mSettleAnimator.end(); |
1264 mSettleAnimator = null; | 1271 mSettleAnimator = null; |
1265 endTransitionAnimations(); | 1272 endTransitionAnimations(); |
1266 } | 1273 } |
1267 } | 1274 } |
OLD | NEW |