| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/android/application_status_listener.h" | 10 #include "base/android/application_status_listener.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 protected: | 50 protected: |
| 51 // Internal method for requesting OfflinePageModel to save page. Exposed for | 51 // Internal method for requesting OfflinePageModel to save page. Exposed for |
| 52 // unit testing. | 52 // unit testing. |
| 53 // TODO(dougarnett): Consider making OfflinePageModel mockable instead. | 53 // TODO(dougarnett): Consider making OfflinePageModel mockable instead. |
| 54 virtual void SavePage( | 54 virtual void SavePage( |
| 55 const OfflinePageModel::SavePageParams& save_page_params, | 55 const OfflinePageModel::SavePageParams& save_page_params, |
| 56 std::unique_ptr<OfflinePageArchiver> archiver, | 56 std::unique_ptr<OfflinePageArchiver> archiver, |
| 57 const SavePageCallback& save_callback); | 57 const SavePageCallback& save_callback); |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 // Progress callback for PrerenderingLoader::LoadPage(). |
| 61 void OnNetworkProgress(const SavePageRequest& request, int64_t bytes); |
| 62 |
| 60 // Callback logic for PrerenderingLoader::LoadPage(). | 63 // Callback logic for PrerenderingLoader::LoadPage(). |
| 61 void OnLoadPageDone(const SavePageRequest& request, | 64 void OnLoadPageDone(const SavePageRequest& request, |
| 62 Offliner::RequestStatus load_status, | 65 Offliner::RequestStatus load_status, |
| 63 content::WebContents* web_contents); | 66 content::WebContents* web_contents); |
| 64 | 67 |
| 65 // Callback logic for OfflinePageModel::SavePage(). | 68 // Callback logic for OfflinePageModel::SavePage(). |
| 66 void OnSavePageDone(const SavePageRequest& request, | 69 void OnSavePageDone(const SavePageRequest& request, |
| 67 SavePageResult save_result, | 70 SavePageResult save_result, |
| 68 int64_t offline_id); | 71 int64_t offline_id); |
| 69 | 72 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 89 // ApplicationStatusListener to monitor if the Chrome moves to the foreground. | 92 // ApplicationStatusListener to monitor if the Chrome moves to the foreground. |
| 90 std::unique_ptr<base::android::ApplicationStatusListener> app_listener_; | 93 std::unique_ptr<base::android::ApplicationStatusListener> app_listener_; |
| 91 base::WeakPtrFactory<PrerenderingOffliner> weak_ptr_factory_; | 94 base::WeakPtrFactory<PrerenderingOffliner> weak_ptr_factory_; |
| 92 | 95 |
| 93 DISALLOW_COPY_AND_ASSIGN(PrerenderingOffliner); | 96 DISALLOW_COPY_AND_ASSIGN(PrerenderingOffliner); |
| 94 }; | 97 }; |
| 95 | 98 |
| 96 } // namespace offline_pages | 99 } // namespace offline_pages |
| 97 | 100 |
| 98 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_OFFLINER_H_ | 101 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_OFFLINER_H_ |
| OLD | NEW |