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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorImpl.java

Issue 2296833002: Add tab persistence support for CustomTabs. (Closed)
Patch Set: Address yusufo@s comments Created 4 years, 3 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
OLDNEW
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.tabmodel; 5 package org.chromium.chrome.browser.tabmodel;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.os.Handler; 8 import android.os.Handler;
9 9
10 import org.chromium.base.VisibleForTesting; 10 import org.chromium.base.VisibleForTesting;
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 @Override 220 @Override
221 public void onCrash(Tab tab, boolean sadTabShown) { 221 public void onCrash(Tab tab, boolean sadTabShown) {
222 if (sadTabShown) { 222 if (sadTabShown) {
223 mTabContentManager.removeTabThumbnail(tab.getId()); 223 mTabContentManager.removeTabThumbnail(tab.getId());
224 } 224 }
225 mUma.onTabCrashed(tab.getId()); 225 mUma.onTabCrashed(tab.getId());
226 } 226 }
227 }; 227 };
228 } 228 }
229 229
230 /**
231 * Exposed to allow tests to initialize the selector with different tab mode ls.
232 * @param normalModel The normal tab model.
233 * @param incognitoModel The incognito tab model.
234 */
235 @VisibleForTesting
236 public void initializeForTesting(TabModel normalModel, TabModel incognitoMod el) {
237 initialize(isIncognitoSelected(), normalModel, incognitoModel);
238 mActiveState = true;
239 }
240
230 @Override 241 @Override
231 public void setCloseAllTabsDelegate(CloseAllTabsDelegate delegate) { 242 public void setCloseAllTabsDelegate(CloseAllTabsDelegate delegate) {
232 mCloseAllTabsDelegate = delegate; 243 mCloseAllTabsDelegate = delegate;
233 } 244 }
234 245
235 @Override 246 @Override
236 public TabModel getModelAt(int index) { 247 public TabModel getModelAt(int index) {
237 return mActiveState ? super.getModelAt(index) : EmptyTabModel.getInstanc e(); 248 return mActiveState ? super.getModelAt(index) : EmptyTabModel.getInstanc e();
238 } 249 }
239 250
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 @Override 426 @Override
416 public void notifyChanged() { 427 public void notifyChanged() {
417 super.notifyChanged(); 428 super.notifyChanged();
418 } 429 }
419 430
420 @VisibleForTesting 431 @VisibleForTesting
421 public TabPersistentStore getTabPersistentStoreForTesting() { 432 public TabPersistentStore getTabPersistentStoreForTesting() {
422 return mTabSaver; 433 return mTabSaver;
423 } 434 }
424 } 435 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698