Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(547)

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java

Issue 2900183003: [Home] Close the bottom sheet when the tab model is switched (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698