OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_ |
| 7 |
| 8 #include "base/callback.h" |
| 9 #include "components/offline_pages/background/offliner.h" |
| 10 |
| 11 class GURL; |
| 12 class PrerenderManager; |
| 13 class Profile; |
| 14 |
| 15 namespace content { |
| 16 class WebContents; |
| 17 class SessionStorageNamespace; |
| 18 } // namespace content |
| 19 |
| 20 namespace gfx { |
| 21 class Size; |
| 22 } // namespace gfx |
| 23 |
| 24 namespace offline_pages { |
| 25 |
| 26 // An Offliner implementation that uses the PrerenderManager for client-side |
| 27 // rendering. This handles loading a page and then saving it to the offline |
| 28 // page model. |
| 29 class PrerenderingLoader { |
| 30 public: |
| 31 typedef base::Callback<void( |
| 32 Offliner::CompletionStatus, |
| 33 content::WebContents*)> LoadPageCallback; |
| 34 |
| 35 explicit PrerenderingLoader(Profile* profile); |
| 36 ~PrerenderingLoader(); |
| 37 |
| 38 bool LoadPage( |
| 39 const GURL url, |
| 40 content::SessionStorageNamespace* session_storage_namespace, |
| 41 const gfx::Size& size, |
| 42 const LoadPageCallback& callback); |
| 43 |
| 44 void StopLoad(); |
| 45 |
| 46 private: |
| 47 // Not owned. |
| 48 Profile* profile_; |
| 49 PrerenderManager* manager_; |
| 50 }; |
| 51 |
| 52 } // namespace offline_pages |
| 53 |
| 54 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_ |
OLD | NEW |