| Index: chrome/browser/android/offline_pages/recent_tab_helper.cc
|
| diff --git a/chrome/browser/android/offline_pages/recent_tab_helper.cc b/chrome/browser/android/offline_pages/recent_tab_helper.cc
|
| index a4afe4299742d0f2090280ed835ee92c992d38d8..191754d8f56833e26d8c2f413394db8cecaa924f 100644
|
| --- a/chrome/browser/android/offline_pages/recent_tab_helper.cc
|
| +++ b/chrome/browser/android/offline_pages/recent_tab_helper.cc
|
| @@ -270,10 +270,11 @@ void RecentTabHelper::WasHidden() {
|
|
|
| // Return immediately if last_n is not listening to tab hidden events, if a
|
| // last_n snapshot is currently being saved or if the tab is closing.
|
| - if (!last_n_listen_to_tab_hidden_ || last_n_ongoing_snapshot_info_) {
|
| + if (!last_n_listen_to_tab_hidden_ || last_n_ongoing_snapshot_info_ ||
|
| + tab_is_closing_) {
|
| DVLOG(1) << "Will not snapshot for last_n (reasons: "
|
| << !last_n_listen_to_tab_hidden_ << ", "
|
| - << !!last_n_ongoing_snapshot_info_
|
| + << !!last_n_ongoing_snapshot_info_ << ", " << tab_is_closing_
|
| << ") for: " << web_contents()->GetLastCommittedURL().spec();
|
| return;
|
| }
|
| @@ -300,6 +301,19 @@ void RecentTabHelper::WasHidden() {
|
| last_n_ongoing_snapshot_info_.get()));
|
| }
|
|
|
| +void RecentTabHelper::WasShown() {
|
| + // If the tab was closing and is now being shown, the closure was reverted.
|
| + DVLOG_IF(0, tab_is_closing_) << "Tab is not closing anymore: "
|
| + << web_contents()->GetLastCommittedURL().spec();
|
| + tab_is_closing_ = false;
|
| +}
|
| +
|
| +void RecentTabHelper::WillCloseTab() {
|
| + DVLOG(1) << "Tab is now closing: "
|
| + << web_contents()->GetLastCommittedURL().spec();
|
| + tab_is_closing_ = true;
|
| +}
|
| +
|
| // TODO(carlosk): rename this to RequestSnapshot and make it return a bool
|
| // representing the acceptance of the snapshot request.
|
| void RecentTabHelper::StartSnapshot() {
|
|
|