Commit 25919fce authored by erikchen's avatar erikchen Committed by Commit Bot

Change implementation of TabStripModel::closing_all().

The semantics of TabStripModel::closing_all() [both in the header comments, and
in usage by callsites] is that it should only be set to |true| when
CloseAllTabs() has been called.

However, it was also being set to |true| in
TabStripModel::DetachWebContentsImpl. This was incorrect. It appears to have
been present in the initial commit of chrome/ to the Chromium repository:
09911bf3.

Bug: 871977
Change-Id: Ied0dcb79611f1c2b144657dec897551d3734a38a
Reviewed-on: https://chromium-review.googlesource.com/1169622Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582130}
parent 4e7082e5
......@@ -303,12 +303,6 @@ void TabStripModel::InsertWebContentsAt(int index,
bool pin = (add_types & ADD_PINNED) != 0;
index = ConstrainInsertionIndex(index, pin);
// In tab dragging situations, if the last tab in the window was detached
// then the user aborted the drag, we will have the |closing_all_| member
// set (see DetachWebContentsAt) which will mess with our mojo here. We need
// to clear this bit.
closing_all_ = false;
// Have to get the active contents before we monkey with the contents
// otherwise we run into problems when we try to change the active contents
// since the old contents and the new contents will be the same...
......@@ -451,7 +445,6 @@ std::unique_ptr<content::WebContents> TabStripModel::DetachWebContentsImpl(
contents_data_.erase(contents_data_.begin() + index);
if (empty()) {
closing_all_ = true;
selection_model_.Clear();
} else {
int old_active = active_index();
......
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