1 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 package org.chromium.chrome.browser.tabmodel; 6 7 import org.chromium.chrome.browser.tab.Tab; 8 import org.chromium.chrome.browser.tab.TabSelectionType; 9 10 /** 11 * This class serves as a callback from TabModel to TabModelSelector. Avoid adding unnecessary 12 * methods that expose too much access to TabModel. http://crbug.com/263579 13 */ 14 public interface TabModelDelegate { 15 /** 16 * Requests the specified to be shown. 17 * @param tab The tab that is requested to be shown. 18 * @param type The reason why this tab was requested to be shown. 19 */ requestToShowTab(Tab tab, @TabSelectionType int type)20 void requestToShowTab(Tab tab, @TabSelectionType int type); 21 22 /** 23 * Delegate a request to close all tabs in a model. 24 * @param incognito Whether the model is incognito. 25 * @return Whether the request was handled. 26 */ closeAllTabsRequest(boolean incognito)27 boolean closeAllTabsRequest(boolean incognito); 28 29 /** 30 * @return Whether reparenting is currently in progress for this TabModel. 31 */ isReparentingInProgress()32 boolean isReparentingInProgress(); 33 34 // TODO(aurimas): clean these methods up. getCurrentModel()35 TabModel getCurrentModel(); getModel(boolean incognito)36 TabModel getModel(boolean incognito); isSessionRestoreInProgress()37 boolean isSessionRestoreInProgress(); selectModel(boolean incognito)38 void selectModel(boolean incognito); 39 } 40