| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_OFFLINER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_OFFLINER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_OFFLINER_H_ | 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_OFFLINER_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/android/offline_pages/prerendering_loader.h" | 8 #include "chrome/browser/android/offline_pages/prerendering_loader.h" |
| 9 #include "components/offline_pages/background/offliner.h" | 9 #include "components/offline_pages/background/offliner.h" |
| 10 #include "components/offline_pages/offline_page_model.h" | 10 #include "components/offline_pages/offline_page_model.h" |
| 11 | 11 |
| 12 class PrerenderManager; | 12 class PrerenderManager; |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 class BrowserContext; |
| 15 class WebContents; | 16 class WebContents; |
| 16 } // namespace content | 17 } // namespace content |
| 17 | 18 |
| 18 namespace offline_pages { | 19 namespace offline_pages { |
| 19 | 20 |
| 20 class OfflinerPolicy; | 21 class OfflinerPolicy; |
| 21 | 22 |
| 22 // An Offliner implementation that attempts client-side rendering and saving | 23 // An Offliner implementation that attempts client-side rendering and saving |
| 23 // of an offline page. It uses the PrerenderingLoader to load the page and | 24 // of an offline page. It uses the PrerenderingLoader to load the page and |
| 24 // the OfflinePageModel to save it. | 25 // the OfflinePageModel to save it. |
| 25 class PrerenderingOffliner : public Offliner { | 26 class PrerenderingOffliner : public Offliner { |
| 26 public: | 27 public: |
| 27 PrerenderingOffliner(const OfflinerPolicy* policy, | 28 PrerenderingOffliner(content::BrowserContext* browser_context, |
| 28 PrerenderManager* prerender_manager, | 29 const OfflinerPolicy* policy, |
| 29 OfflinePageModel* offline_page_model); | 30 OfflinePageModel* offline_page_model); |
| 30 ~PrerenderingOffliner() override; | 31 ~PrerenderingOffliner() override; |
| 31 | 32 |
| 32 bool LoadAndSave(const SavePageRequest& request, | 33 bool LoadAndSave(const SavePageRequest& request, |
| 33 const CompletionCallback& callback) override; | 34 const CompletionCallback& callback) override; |
| 34 | 35 |
| 35 void Cancel() override; | 36 void Cancel() override; |
| 36 | 37 |
| 37 private: | 38 private: |
| 38 std::unique_ptr<PrerenderingLoader> loader_; | 39 std::unique_ptr<PrerenderingLoader> loader_; |
| 39 }; | 40 }; |
| 40 | 41 |
| 41 } // namespace offline_pages | 42 } // namespace offline_pages |
| 42 | 43 |
| 43 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_OFFLINER_H_ | 44 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_OFFLINER_H_ |
| OLD | NEW |