| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 void SetApplicationStateForTesting( | 49 void SetApplicationStateForTesting( |
| 50 base::android::ApplicationState application_state); | 50 base::android::ApplicationState application_state); |
| 51 | 51 |
| 52 protected: | 52 protected: |
| 53 // Internal method for requesting OfflinePageModel to save page. Exposed for | 53 // Internal method for requesting OfflinePageModel to save page. Exposed for |
| 54 // unit testing. | 54 // unit testing. |
| 55 // TODO(dougarnett): Consider making OfflinePageModel mockable instead. | 55 // TODO(dougarnett): Consider making OfflinePageModel mockable instead. |
| 56 virtual void SavePage( | 56 virtual void SavePage( |
| 57 const OfflinePageModel::SavePageParams& save_page_params, | 57 const OfflinePageModel::SavePageParams& save_page_params, |
| 58 std::unique_ptr<OfflinePageArchiver> archiver, | 58 std::unique_ptr<OfflinePageArchiver> archiver, |
| 59 const std::string& signal_data, |
| 59 const SavePageCallback& save_callback); | 60 const SavePageCallback& save_callback); |
| 60 | 61 |
| 61 private: | 62 private: |
| 62 // Progress callback for PrerenderingLoader::LoadPage(). | 63 // Progress callback for PrerenderingLoader::LoadPage(). |
| 63 void OnNetworkProgress(const SavePageRequest& request, int64_t bytes); | 64 void OnNetworkProgress(const SavePageRequest& request, int64_t bytes); |
| 64 | 65 |
| 65 // Callback logic for PrerenderingLoader::LoadPage(). | 66 // Callback logic for PrerenderingLoader::LoadPage(). |
| 66 void OnLoadPageDone(const SavePageRequest& request, | 67 void OnLoadPageDone(const SavePageRequest& request, |
| 67 Offliner::RequestStatus load_status, | 68 Offliner::RequestStatus load_status, |
| 68 content::WebContents* web_contents); | 69 content::WebContents* web_contents); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 99 // ApplicationStatusListener to monitor if the Chrome moves to the foreground. | 100 // ApplicationStatusListener to monitor if the Chrome moves to the foreground. |
| 100 std::unique_ptr<base::android::ApplicationStatusListener> app_listener_; | 101 std::unique_ptr<base::android::ApplicationStatusListener> app_listener_; |
| 101 base::WeakPtrFactory<PrerenderingOffliner> weak_ptr_factory_; | 102 base::WeakPtrFactory<PrerenderingOffliner> weak_ptr_factory_; |
| 102 | 103 |
| 103 DISALLOW_COPY_AND_ASSIGN(PrerenderingOffliner); | 104 DISALLOW_COPY_AND_ASSIGN(PrerenderingOffliner); |
| 104 }; | 105 }; |
| 105 | 106 |
| 106 } // namespace offline_pages | 107 } // namespace offline_pages |
| 107 | 108 |
| 108 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_OFFLINER_H_ | 109 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_OFFLINER_H_ |
| OLD | NEW |