Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Unified Diff: chrome/browser/android/offline_pages/recent_tab_helper.h

Issue 2705323006: Last_n: Do not save a snapshot of a closing tab. (Closed)
Patch Set: Rebase after base change landed. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/offline_pages/recent_tab_helper.h
diff --git a/chrome/browser/android/offline_pages/recent_tab_helper.h b/chrome/browser/android/offline_pages/recent_tab_helper.h
index 50a3cda30a7d4b05c1d01307e0f37ae044768461..6c43a23be1961e0fbd1973a66e7ba5354585e074 100644
--- a/chrome/browser/android/offline_pages/recent_tab_helper.h
+++ b/chrome/browser/android/offline_pages/recent_tab_helper.h
@@ -40,6 +40,11 @@ class RecentTabHelper
void DocumentOnLoadCompletedInMainFrame() override;
void WebContentsDestroyed() override;
void WasHidden() override;
+ void WasShown() override;
+
+ // Notifies that the tab of the associated WebContents will (most probably) be
+ // closed. This call is expected to always happen before the one to WasHidden.
+ void WillCloseTab();
// SnapshotController::Client
void StartSnapshot() override;
@@ -144,6 +149,10 @@ class RecentTabHelper
// current page being loaded.
bool last_n_listen_to_tab_hidden_ = false;
+ // Set to true when the tab containing the associated WebContents is in the
+ // process of being closed.
+ bool tab_is_closing_ = false;
+
base::WeakPtrFactory<RecentTabHelper> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(RecentTabHelper);
« no previous file with comments | « chrome/browser/android/offline_pages/offline_page_bridge.cc ('k') | chrome/browser/android/offline_pages/recent_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698