Allow close dialog to be shown when tabs icon is pressed

This commit is contained in:
Anthony Restaino 2016-02-05 22:23:43 -05:00
parent f1467a9a96
commit 000ecbdc25
3 changed files with 7 additions and 1 deletions

View File

@ -828,7 +828,8 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
quit.setOnClickListener(this); quit.setOnClickListener(this);
} }
private void showCloseDialog(final int position) { @Override
public void showCloseDialog(final int position) {
if (position < 0) { if (position < 0) {
return; return;
} }

View File

@ -51,4 +51,6 @@ public interface UIController {
void closeEmptyTab(); void closeEmptyTab();
void showCloseDialog(int position);
} }

View File

@ -167,6 +167,9 @@ public class TabsFragment extends Fragment implements View.OnClickListener, View
@Override @Override
public void onClick(@NonNull View v) { public void onClick(@NonNull View v) {
switch (v.getId()) { switch (v.getId()) {
case R.id.tab_header_button:
mUiController.showCloseDialog(tabsManager.indexOfCurrentTab());
break;
case R.id.new_tab_button: case R.id.new_tab_button:
mBus.post(new TabEvents.NewTab()); mBus.post(new TabEvents.NewTab());
break; break;