| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.emptybackground; | 5 package org.chromium.chrome.browser.widget.emptybackground; |
| 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.ObjectAnimator; | 9 import android.animation.ObjectAnimator; |
| 10 import android.content.Context; | 10 import android.content.Context; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 @Override | 53 @Override |
| 54 public void onFinishInflate() { | 54 public void onFinishInflate() { |
| 55 super.onFinishInflate(); | 55 super.onFinishInflate(); |
| 56 | 56 |
| 57 View newTabButton = findViewById(R.id.empty_new_tab_button); | 57 View newTabButton = findViewById(R.id.empty_new_tab_button); |
| 58 newTabButton.setOnClickListener(new OnClickListener() { | 58 newTabButton.setOnClickListener(new OnClickListener() { |
| 59 @Override | 59 @Override |
| 60 public void onClick(View v) { | 60 public void onClick(View v) { |
| 61 if (mTabCreator == null) return; | 61 if (mTabCreator == null) return; |
| 62 mTabModelSelector.getModel(false).commitAllTabClosures(); |
| 62 mTabCreator.launchNTP(); | 63 mTabCreator.launchNTP(); |
| 63 } | 64 } |
| 64 }); | 65 }); |
| 65 | 66 |
| 66 buildAnimatorSets(); | 67 buildAnimatorSets(); |
| 67 } | 68 } |
| 68 | 69 |
| 69 /** | 70 /** |
| 70 * Sets the {@link TabModelSelector} that will be queried for information ab
out the state of | 71 * Sets the {@link TabModelSelector} that will be queried for information ab
out the state of |
| 71 * the system. | 72 * the system. |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 | 165 |
| 165 @Override | 166 @Override |
| 166 public void onAnimationEnd(Animator animation) { | 167 public void onAnimationEnd(Animator animation) { |
| 167 setVisibility(View.GONE); | 168 setVisibility(View.GONE); |
| 168 mCurrentTransitionAnimation = null; | 169 mCurrentTransitionAnimation = null; |
| 169 mIncognitoToggleButton.setEnabled(true); | 170 mIncognitoToggleButton.setEnabled(true); |
| 170 } | 171 } |
| 171 }); | 172 }); |
| 172 } | 173 } |
| 173 } | 174 } |
| OLD | NEW |