| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 void SetApplicationStateForTesting( | 47 void SetApplicationStateForTesting( |
| 48 base::android::ApplicationState application_state); | 48 base::android::ApplicationState application_state); |
| 49 | 49 |
| 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 std::vector<std::string>& signal_data, |
| 57 const SavePageCallback& save_callback); | 58 const SavePageCallback& save_callback); |
| 58 | 59 |
| 59 private: | 60 private: |
| 60 // Callback logic for PrerenderingLoader::LoadPage(). | 61 // Callback logic for PrerenderingLoader::LoadPage(). |
| 61 void OnLoadPageDone(const SavePageRequest& request, | 62 void OnLoadPageDone(const SavePageRequest& request, |
| 62 Offliner::RequestStatus load_status, | 63 Offliner::RequestStatus load_status, |
| 63 content::WebContents* web_contents); | 64 content::WebContents* web_contents); |
| 64 | 65 |
| 65 // Callback logic for OfflinePageModel::SavePage(). | 66 // Callback logic for OfflinePageModel::SavePage(). |
| 66 void OnSavePageDone(const SavePageRequest& request, | 67 void OnSavePageDone(const SavePageRequest& request, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 89 // ApplicationStatusListener to monitor if the Chrome moves to the foreground. | 90 // ApplicationStatusListener to monitor if the Chrome moves to the foreground. |
| 90 std::unique_ptr<base::android::ApplicationStatusListener> app_listener_; | 91 std::unique_ptr<base::android::ApplicationStatusListener> app_listener_; |
| 91 base::WeakPtrFactory<PrerenderingOffliner> weak_ptr_factory_; | 92 base::WeakPtrFactory<PrerenderingOffliner> weak_ptr_factory_; |
| 92 | 93 |
| 93 DISALLOW_COPY_AND_ASSIGN(PrerenderingOffliner); | 94 DISALLOW_COPY_AND_ASSIGN(PrerenderingOffliner); |
| 94 }; | 95 }; |
| 95 | 96 |
| 96 } // namespace offline_pages | 97 } // namespace offline_pages |
| 97 | 98 |
| 98 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_OFFLINER_H_ | 99 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_OFFLINER_H_ |
| OLD | NEW |