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

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

Issue 1915983008: Adds shells of classes (PrerenderingOffliner and PrerenderingLoader) to intergrate from Background … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: chrome/browser/android/offline_pages/prerendering_loader.h
diff --git a/chrome/browser/android/offline_pages/prerendering_loader.h b/chrome/browser/android/offline_pages/prerendering_loader.h
new file mode 100644
index 0000000000000000000000000000000000000000..a30bc1be101a4e0f7fb9bf937c6580e1642ef226
--- /dev/null
+++ b/chrome/browser/android/offline_pages/prerendering_loader.h
@@ -0,0 +1,54 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_
+#define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_
+
+#include "base/callback.h"
+#include "components/offline_pages/background/offliner.h"
+
+class GURL;
+class PrerenderManager;
+class Profile;
+
+namespace content {
+class WebContents;
+class SessionStorageNamespace;
+} // namespace content
+
+namespace gfx {
+class Size;
+} // namespace gfx
+
+namespace offline_pages {
+
+// An Offliner implementation that uses the PrerenderManager for client-side
+// rendering. This handles loading a page and then saving it to the offline
+// page model.
+class PrerenderingLoader {
+ public:
+ typedef base::Callback<void(
+ Offliner::CompletionStatus,
+ content::WebContents*)> LoadPageCallback;
+
+ explicit PrerenderingLoader(Profile* profile);
+ ~PrerenderingLoader();
+
+ bool LoadPage(
+ const GURL url,
+ content::SessionStorageNamespace* session_storage_namespace,
+ const gfx::Size& size,
+ const LoadPageCallback& callback);
+
+ void StopLoad();
+
+ private:
+ // Not owned.
+ Profile* profile_;
+ PrerenderManager* manager_;
+};
+
+} // namespace offline_pages
+
+#endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_

Powered by Google App Engine
This is Rietveld 408576698