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

Unified Diff: components/offline_pages/core/snapshot_controller.h

Issue 2861583007: [Offline pages]: Move logic for whether to consider the DocumentAvailableInMainFrame signal to the … (Closed)
Patch Set: Created 3 years, 8 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: components/offline_pages/core/snapshot_controller.h
diff --git a/components/offline_pages/core/snapshot_controller.h b/components/offline_pages/core/snapshot_controller.h
index 36e1680a6f03f515a7c0305eef0669a6602796d6..bcd5ee00b1b7af139299a91b3dd13c8cd9592e4d 100644
--- a/components/offline_pages/core/snapshot_controller.h
+++ b/components/offline_pages/core/snapshot_controller.h
@@ -60,14 +60,23 @@ class SnapshotController {
virtual ~Client() {}
};
- SnapshotController(
+ // Creates a SnapshotController with document available delay = 7s,
+ // document on load delay = 1s and triggers snapshot on document available.
+ static std::unique_ptr<SnapshotController> CreateForForegroundOfflining(
+ const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
+ SnapshotController::Client* client);
+ // Creates a SnapshotController with document on load delay = 2s
+ // and ignores document available signal.
+ static std::unique_ptr<SnapshotController> CreateForBackgroundOfflining(
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
SnapshotController::Client* client);
+
SnapshotController(
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
SnapshotController::Client* client,
int64_t delay_after_document_available_ms,
- int64_t delay_after_document_on_load_completed_ms);
+ int64_t delay_after_document_on_load_completed_ms,
+ bool document_available_triggers_snapshot);
virtual ~SnapshotController();
// Resets the 'session', returning controller to initial state.
@@ -103,6 +112,7 @@ class SnapshotController {
SnapshotController::State state_;
int64_t delay_after_document_available_ms_;
int64_t delay_after_document_on_load_completed_ms_;
+ bool document_available_triggers_snapshot_;
// The expected quality of a snapshot taken at the moment this value is
// queried.
« no previous file with comments | « chrome/browser/android/offline_pages/recent_tab_helper.cc ('k') | components/offline_pages/core/snapshot_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698