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

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

Issue 2278773002: Modify RecentTabHelper to be always-on and observe the loading of the pages. (Closed)
Patch Set: Created 4 years, 4 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 b672827bec81e42da771daf3c10fa5bbe2a75aee..f17adb003fbde93a98e769d6ad77d48bbd2241ae 100644
--- a/chrome/browser/android/offline_pages/recent_tab_helper.h
+++ b/chrome/browser/android/offline_pages/recent_tab_helper.h
@@ -34,6 +34,8 @@ class RecentTabHelper
~RecentTabHelper() override;
// content::WebContentsObserver
+ void DidStartNavigation(
+ content::NavigationHandle* navigation_handle) override;
void DidFinishNavigation(
content::NavigationHandle* navigation_handle) override;
void DocumentAvailableInMainFrame() override;
@@ -55,12 +57,16 @@ class RecentTabHelper
};
void SetDelegate(std::unique_ptr<RecentTabHelper::Delegate> delegate);
+ bool is_page_ready_for_snapshot() const {
+ return is_page_ready_for_snapshot_;
+ }
+
private:
explicit RecentTabHelper(content::WebContents* web_contents);
friend class content::WebContentsUserData<RecentTabHelper>;
- void LazyInitialize();
+ void EnsureInitialized();
void ContinueSnapshotWithIdsToPurge(const std::vector<int64_t>& page_ids);
void ContinueSnapshotAfterPurge(OfflinePageModel::DeletePageResult result);
void SavePageCallback(OfflinePageModel::SavePageResult result,
@@ -73,7 +79,11 @@ class RecentTabHelper
// Page model is a service, no ownership.
OfflinePageModel* page_model_;
dewittj 2016/08/24 23:01:39 please document that page_model_ can be null even
Dmitry Titov 2016/08/25 00:36:09 Done.
// If false, never make snapshots off the attached WebContents.
+ // Not page-specific.
bool snapshots_enabled_;
+ // Becomes true during navigation if the page is ready for snapshot as
+ // indicated by at least one callback from SnapshotController.
+ bool is_page_ready_for_snapshot_;
// If empty, the tab does not have AndroidId and can not capture pages.
std::string tab_id_;

Powered by Google App Engine
This is Rietveld 408576698