Commit f86de2b1 authored by twellington's avatar twellington Committed by Commit bot

Add TabModel.closeAllTabs(boolean allowDelegation)

BUG=268157

Review URL: https://codereview.chromium.org/657983003

Cr-Commit-Position: refs/heads/master@{#301125}
parent 3e7ecf78
......@@ -57,6 +57,10 @@ public class EmptyTabModel implements TabModel {
public void closeAllTabs() {
}
@Override
public void closeAllTabs(boolean allowDelegation) {
}
@Override
public int getCount() {
// We must return 0 to be consistent with getTab(i)
......
......@@ -83,6 +83,14 @@ public interface TabModel extends TabList {
*/
public void closeAllTabs();
/**
* Close all tabs on this model. If allowDelegation is true, the model has the option
* of not closing all tabs and delegating the closure to another class.
* @param allowDelegation true iff the model may delegate the close all request.
* false iff the model must close all tabs.
*/
public void closeAllTabs(boolean allowDelegation);
/**
* @return Whether or not this model supports pending closures.
*/
......
......@@ -323,6 +323,11 @@ public abstract class TabModelBase extends TabModelJniBridge {
@Override
public void closeAllTabs() {
closeAllTabs(true);
}
@Override
public void closeAllTabs(boolean allowDelegation) {
commitAllTabClosures();
while (getCount() > 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment