| 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_BACKGROUND_LOADER_OFFLINER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_ | 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_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 20 matching lines...) Expand all Loading... |
| 31 public: | 31 public: |
| 32 BackgroundLoaderOffliner(content::BrowserContext* browser_context, | 32 BackgroundLoaderOffliner(content::BrowserContext* browser_context, |
| 33 const OfflinerPolicy* policy, | 33 const OfflinerPolicy* policy, |
| 34 OfflinePageModel* offline_page_model); | 34 OfflinePageModel* offline_page_model); |
| 35 ~BackgroundLoaderOffliner() override; | 35 ~BackgroundLoaderOffliner() override; |
| 36 | 36 |
| 37 // Offliner implementation. | 37 // Offliner implementation. |
| 38 bool LoadAndSave(const SavePageRequest& request, | 38 bool LoadAndSave(const SavePageRequest& request, |
| 39 const CompletionCallback& callback) override; | 39 const CompletionCallback& callback) override; |
| 40 void Cancel() override; | 40 void Cancel() override; |
| 41 bool HandleTimeout(const SavePageRequest& request) override; |
| 41 | 42 |
| 42 // WebContentsObserver implementation. | 43 // WebContentsObserver implementation. |
| 43 void DidStopLoading() override; | 44 void DidStopLoading() override; |
| 44 void RenderProcessGone(base::TerminationStatus status) override; | 45 void RenderProcessGone(base::TerminationStatus status) override; |
| 45 void WebContentsDestroyed() override; | 46 void WebContentsDestroyed() override; |
| 46 void DidFinishNavigation( | 47 void DidFinishNavigation( |
| 47 content::NavigationHandle* navigation_handle) override; | 48 content::NavigationHandle* navigation_handle) override; |
| 48 | 49 |
| 49 protected: | 50 protected: |
| 50 // Called to reset internal loader and observer state. | 51 // Called to reset internal loader and observer state. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 80 SaveState save_state_; | 81 SaveState save_state_; |
| 81 // Page load state. | 82 // Page load state. |
| 82 PageLoadState page_load_state_; | 83 PageLoadState page_load_state_; |
| 83 | 84 |
| 84 base::WeakPtrFactory<BackgroundLoaderOffliner> weak_ptr_factory_; | 85 base::WeakPtrFactory<BackgroundLoaderOffliner> weak_ptr_factory_; |
| 85 DISALLOW_COPY_AND_ASSIGN(BackgroundLoaderOffliner); | 86 DISALLOW_COPY_AND_ASSIGN(BackgroundLoaderOffliner); |
| 86 }; | 87 }; |
| 87 | 88 |
| 88 } // namespace offline_pages | 89 } // namespace offline_pages |
| 89 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_ | 90 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_ |
| OLD | NEW |