| 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_
|
|
|