diff options
-rw-r--r-- | chrome/browser/tabs/tab_strip_model.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc index a60268b..306fb7f 100644 --- a/chrome/browser/tabs/tab_strip_model.cc +++ b/chrome/browser/tabs/tab_strip_model.cc @@ -679,8 +679,14 @@ void TabStripModel::ExecuteContextMenuCommand( UserMetricsAction("TabContextMenu_TogglePinned"), profile_); - SelectTabContentsAt(context_index, true); - SetTabPinned(context_index, !IsTabPinned(context_index)); + if (IsPhantomTab(context_index)) { + // The tab is a phantom tab, close it. + CloseTabContentsAt(context_index, + CLOSE_USER_GESTURE | CLOSE_CREATE_HISTORICAL_TAB); + } else { + SelectTabContentsAt(context_index, true); + SetTabPinned(context_index, !IsTabPinned(context_index)); + } break; } |